<template>
  <div class="app-container">
    <div class="app-container__item">
      <div class="app-container__item-h1">字段提交页面</div>
      <div class="app-container__item-body">
        <div class="app-container__item-body-value">
          <xd-json-view :data="XdBaseFieldValue" show level="1"></xd-json-view>
        </div>
        <div id="test-cav">
          <div v-if="0" @click="handleImage()">我要生成快照</div>
          <xd-base-dynamic-field
            label-width="160px"
            ref="testForm"
            v-model="XdBaseFieldValue"
            :list="formListTest"
            size="medium"
            @success="handleSuccess"
            @onApiSuccessUrl="handleApiSuccessUrl"
            @onGetParamsAndHeader="handleGetParamsAndHeader"
            class="styleActive"
          >
<!--            <template slot="form" slot-scope="scope">-->
<!--              <el-form-->
<!--                :label-width="scope.width"-->
<!--                :model="ruleForm"-->
<!--                :rules="rules"-->
<!--                class="demo-ruleForm">-->
<!--                <el-form-item label="活动名称" prop="name">-->
<!--                  <el-input v-model="ruleForm.name"></el-input>-->
<!--                </el-form-item>-->
<!--                <el-form-item label="活动区域" prop="region">-->
<!--                  <el-select v-model="ruleForm.region" placeholder="请选择活动区域">-->
<!--                    <el-option label="区域一" value="shanghai"></el-option>-->
<!--                    <el-option label="区域二" value="beijing"></el-option>-->
<!--                  </el-select>-->
<!--                </el-form-item>-->
<!--              </el-form>-->
<!--            </template>-->
<!--            <template slot="full" slot-scope="scope">-->
<!--              <xd-base-dynamic-field-->
<!--                :label-width="scope.width"-->
<!--                :list="formListTest2"-->
<!--                size="medium"-->
<!--              >-->
<!--              </xd-base-dynamic-field>-->
<!--            </template>-->
<!--            <template slot="full2" slot-scope="scope">-->
<!--              <xd-base-dynamic-field-->
<!--                :label-width="scope.width"-->
<!--                :list="formListTest3"-->
<!--                size="medium"-->
<!--              >-->
<!--              </xd-base-dynamic-field>-->
<!--            </template>-->
          </xd-base-dynamic-field>
        </div>
        <el-button @click="handleCilck" type="primary">提交</el-button>
      </div>
    </div>
    <div class="app-container__item" v-if="0">
      <div class="app-container__item-h1">搜索模块</div>
      <div class="app-container__item-body">
        <div class="app-container__item-body-value">
          <xd-json-view :data="xdSearchValue" show level="1"></xd-json-view>
        </div>
        <xd-search
          main-filter-key="main_key"
          :main-filter="null"
          :main-filter-index="4"
          :main-filter-stretch="false"
          main-filter-type=""
          v-model="xdSearchValue"
          :list="null"
          :remote-search="handleRemoteSearch"
          size="medium"
          @onSearch="handleSearch"
          @onDone="handleDone"
        >
          <template slot="time">我是插槽</template>
        </xd-search>
      </div>
    </div>
    <div class="app-container__item"  v-if="0">
      <div class="app-container__item-h1">Table Form</div>
      <div class="app-container__item-body">
        <div class="app-container__item-body-value" v-if="0">
          <xd-json-view :data="XdBaseFieldValue" show level="1"></xd-json-view>
        </div>
        <xd-table-form
          :list="tableFormList"
          :width="tableWidth"
        >
        </xd-table-form>
        <el-button @click="handleCilck" type="primary">提交</el-button>
      </div>
    </div>
  </div>
</template>

<script>
  import XdJsonView from "@/components/XdJsonView";
  import XdSearch from "@/components/XdSearch";
  import XdBaseDynamicField from "@/components/XdBaseDynamicField";
  import {genUpToken} from './../scripts/qiniu'
  import XdTableForm from "@/components/XdTableForm";
  import testData from "@/dome/base/form/testData";
  import cityData from "@/cityData"
  import axios from 'axios';
  import router from './router';
  console.log('router', getEditPagesTreeToPathArr(router.data));
  import {getEditPagesTreeToPathArr} from "@/utils/xd.base";
  import site from "@/dome/base/form/site";
  import app from "@/dome/base/form/app"
  import html2canvas from 'html2canvas';
  import downloadJs from "downloadjs";



  export default {
    name: 'AppForm',
    components: {
      XdTableForm,
      XdBaseDynamicField,
      XdSearch,
      XdJsonView
    },
    data() {
      return {
        xdSearchValue: [],
        XdBaseFieldValue: {},
        list: [
          {"label": "万利达集团", "value": 4},
          {"label": "万利达集团-2", "value": 5},
          {"label": "深圳万利达移动通信设备有限公司", "value": 6},
          {"label": "味多美", "value": 7},
          {"label": "味多美", "value": '7'},
        ],

        token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9zYW5kYm94LWMuanVmdWJhby5jbiIsImlhdCI6MTY0MDE0NDI0MywiZXhwIjoxNjQwMjMwNjQzLCJhY2NvdW50X2lkIjo4LCJtZXJjaGFudF9pZCI6IjBfb05ua2M2SHVtd1JqV0Nja3c3WFBxdmNpbWJyWSIsInBsYXRmb3JtX2NvZGUiOiJ3eCIsImlwIjoiMTAuMC4yLjQiLCJjaGVja3N1bSI6ImFhYmNkNzJhNTRlYmE0MjI3MGMyODYzNzI1MTk5ODEyIn0.e7AgEQKtj_Ju7-_FQbTEdqZTpKs1DtX2RVe8ZH-MKoE',
        getCity: 'http://sandbox-c.jufubao.cn/api/pb/city/getsub',

        //el-form
        ruleForm: {
          name: '',
          region: '',
        },
        rules: {
          name: [
            {required: true, message: '请输入活动名称', trigger: 'blur'},
            {min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur'}
          ],
          region: [
            {required: true, message: '请选择活动区域', trigger: 'change'}
          ]
        },

        formTestTemp : [
          {
            label: '复选框:',
            ele: 'xd-item-notice',
            valueKey: 'xd-check-notice',
            value: [1],
            //value: 1,
            setting:{
              inline: false, //true 行内显示  false 换行显示  null: 系统自己判断(默认),
              type: 'check', //check复选框  //radio 单选
            },
            className: 'input100',
            handleCustom({action, data}) {
              setTimeout(()=>{
                data.cb([
                  {label: '周期消费（实时风控）', value: 3,notes: '绑定值'},
                  {label: '周期下单', value: 1, notes: '多选框组尺寸，仅对按钮形式的 Checkbox 或带有边框的 Checkbox 有效'},
                  {label: '周期成单率', value: 2, notes: '按钮形式的 Checkbox 激活时的文本颜色'},
                  {label: '周期绑卡', value: 4,notes: '按钮形式的 Checkbox 激活时的填充色和边框色'},
                  // {label: 'value / v-model', value: 3},
                  // {label: 'size', value: 1,},
                  // {label: 'text-color', value: 2,},
                  // {label: 'fill', value: 4,notes: '按钮形式的 Checkbox 激活时的填充色和边框色'},
                  // {label: 'value / v-model', value: 5},
                  // {label: 'size', value: 6,},
                  // {label: 'text-color', value: 7,},
                  // {label: 'value / v-model', value: 8},
                  // {label: 'size', value: 9,},
                  // {label: 'text-color', value: 20,},
                ])
              }, 1000)
            },
          },
          {
            label: '内容圆角设置:',
            ele: 'xd-remote-select-list',
            valueKey: 'select-remote',
            value: [1,3],

            placeholder: '请选择内容圆角设置',
            setting: {
              multiple: true,
            },
            className: 'input50',
            handleCustom({action, data}) {
              setTimeout(()=>{
                data.cb([
                  {label: '1', value: 1},
                  {label: '2', value: 2},
                  {label: '3', value: 3},
                  {label: '4', value: 4},
                ])
              }, 1000)
            },
          },
        ],

        formListTest: [
          {
            ele: 'title',
            label: '基础信息',
            size: 'mini',
            hidden: false,
          },
          {
            label: '多级输入框:', //label
            ele: 'xd-multiple-input', //package 名称
            valueKey: 'xd-multiple-input', //form[valueKey]
            groupKey:'style',
            //默认值
            value: {
              input: '多级输入框',
              price: 20000,
              select: '',
              selectbox: [],
              time: '19-30'
            },
            disabled: false,
            setting: {
              after: '生日前',
              inputs: [
                {type: 'input', key: 'trigger_day', unit: '小时'},
                {
                  type: 'time',
                  key: 'trigger_time', //返回键值
                  formatValue: '-', //输出时间格式:19-20
                  options: {
                    start: '00:00',
                    step: '00:30',
                    end: '23:59'
                  },
                  value: '19-30',
                  unit: '发放'
                },
                {type: 'input', key: 'price', unit: '元', isPrice: true},
                {
                  type: 'select',
                  key: 'select',
                  list: [
                    {"label": "万利达集团", "value": 1},
                    {"label": "深圳万利达", "value": 2},
                    {"label": "移动通信设备有限公司", "value": 3},
                    {"label": "味多美", "value": 4},
                  ],
                  unit: '元',
                  multiple: false
                },
                {
                  type: 'select',
                  key: 'selectbox',
                  list: [
                    {"label": "万利达集团", "value": 1},
                    {"label": "深圳万利达", "value": 2},
                    {"label": "移动通信设备有限公司", "value": 3},
                    {"label": "味多美", "value": 4},
                  ],
                  multiple: true
                },
              ],
              before:'<span style="color:#999; font-size: 12px">时间发放福利。</span>',
            },
            rules: [
              {required: true, message: '请添加内容', trigger: 'change'},
            ],
          },
          {
            label: '域名名称:', //label
            ele: 'xd-group-input', //package 名称
            valueKey: 'domain_group_name', //form[valueKey]
            groupKey:'style',
            value: ['1234567890'], //v-model
            placeholder: '输入域名名称',
            className: 'input60',
            disabled: false,
            hidden:false,
            setting: {
              type: 'text',
              row:5,
              // maxCharLen: 10, //
              // minCharLen:2
            },
            rules: [
              {required: true, message: '请输入域名地址', trigger: 'change'},
            ],
            notice: '深圳万利达移动通信设备有限公司',
            inline: false,
          },
          {
            ele: 'title',
            label: '基础信息2',
            size: 'mini',
            hidden: false,
          },
          {
            label: '复选框:',
            ele: 'xd-item-notice',
            valueKey: 'xd-check-notice',
            value: [1],
            groupKey:'style',
            //value: 1,
            setting:{
              inline: false, //true 行内显示  false 换行显示  null: 系统自己判断(默认),
              type: 'check', //check复选框  //radio 单选
            },
            className: 'input100',
            handleCustom({action, data}) {
              setTimeout(()=>{
                data.cb([
                  {label: '周期消费（实时风控）', value: 3,notes: '绑定值'},
                  {label: '周期下单', value: 1, notes: '多选框组尺寸，仅对按钮形式的 Checkbox 或带有边框的 Checkbox 有效'},
                  {label: '周期成单率', value: 2, notes: '按钮形式的 Checkbox 激活时的文本颜色'},
                  {label: '周期绑卡', value: 4,notes: '按钮形式的 Checkbox 激活时的填充色和边框色'},
                  // {label: 'value / v-model', value: 3},
                  // {label: 'size', value: 1,},
                  // {label: 'text-color', value: 2,},
                  // {label: 'fill', value: 4,notes: '按钮形式的 Checkbox 激活时的填充色和边框色'},
                  // {label: 'value / v-model', value: 5},
                  // {label: 'size', value: 6,},
                  // {label: 'text-color', value: 7,},
                  // {label: 'value / v-model', value: 8},
                  // {label: 'size', value: 9,},
                  // {label: 'text-color', value: 20,},
                ])
              }, 1000)
            },
          },
          {
            label: '单选:',
            ele: 'xd-item-notice',
            valueKey: 'xd-radio-notice',
            value: 1,
            disabled: true,
            setting:{
              inline: false, //true 行内显示  false 换行显示  null: 系统自己判断(默认),
              type: 'radio', //check复选框  //radio 单选
              icon: true,
            },
            className: 'input100',
            handleCustom({action, data}) {
              setTimeout(()=>{
                data.cb([
                  {label: '周期消费（实时风控）', value: 3,notes: '绑定值'},
                  {label: '周期下单', value: 1, notes: '多选框组尺寸，仅对按钮形式的 Checkbox 或带有边框的 Checkbox 有效'},
                  {label: '周期成单率', value: 2, notes: '按钮形式的 Checkbox 激活时的文本颜色'},
                  {label: '周期绑卡', value: 4,notes: '按钮形式的 Checkbox 激活时的填充色和边框色'},
                  // {label: 'value / v-model', value: 3},
                  // {label: 'size', value: 1,},
                  // {label: 'text-color', value: 2,},
                  // {label: 'fill', value: 4,notes: '按钮形式的 Checkbox 激活时的填充色和边框色'},
                  // {label: 'value / v-model', value: 5},
                  // {label: 'size', value: 6,},
                  // {label: 'text-color', value: 7,},
                  // {label: 'value / v-model', value: 8},
                  // {label: 'size', value: 9,},
                  // {label: 'text-color', value: 20,},
                ])
              }, 1000)
            },
          },
          {
            ele: 'title',
            label: '基础信息3',
            size: 'mini',
            hidden: false,
          },
          {
            label: '远程列表选择:',
            ele: 'xd-remote-select-list',
            valueKey: 'select-remote',
            value: [1,3],

            placeholder: '请选择内容圆角设置',
            setting: {
              multiple: true,
            },
            className: 'input50',
            handleCustom({action, data}) {
              setTimeout(()=>{
                data.cb([
                  {label: '1', value: 1},
                  {label: '2', value: 2},
                  {label: '3', value: 3},
                  {label: '4', value: 4},
                ])
              }, 2000)
            },
          },
          {
            label: '域名名称:', //label
            ele: 'el-input', //package 名称
            type: 'text',
            valueKey: 'domain_name_01', //form[valueKey]
            value: '', //v-model
            placeholder: '输入域名名称',
            className: 'input40', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
            groupKey: 'content',
            rules: [
              {required: true, message: '请输入域名地址', trigger: 'blur'},
            ]
          },
          {
            label: '新选择插件:', //label
            ele: 'xd-set-label', //package 名称
            valueKey: 'xd-set-label', //form[valueKey]
            defaultValue: [
            {
                label:'推荐分类',
                value: 'rec',
                newLabel: '哈哈哈哈'
              },
              {
                label:'热门分类',
                value: 'hot',
                newLabel: '新品分类'
              }
            ],
            value: [], //v-model
            disabled: false,
            list: [
              {
                label:'推荐分类',
                value: 'rec'
              },
              {
                label:'热门分类',
                value: 'hot'
              }
            ]
          },
          {
            ele: 'title',
            label: '基础信息4',
            size: 'mini',
            hidden: false,
          },
          {
            label: '新选择排序插件:', //label
            ele: 'xd-set-sort-label', //package 名称
            valueKey: 'xd-set-sort-label', //form[valueKey]
            defaultValue: [
            {
                label:'推荐分类',
                value: 'rec',
                newLabel: '哈哈哈哈',
                // sort:1
              },
              {
                label:'热门分类',
                value: 'hot',
                newLabel: '新品分类',
                // sort:2
              }
            ],
            value: [], //v-model
            disabled: false,
            list: [
              {
                label:'推荐分类',
                value: 'rec',
                sort:1
              },
              {
                label:'热门分类',
                value: 'hot',
                sort:2
              }
            ]
          },
          {
            label: '新穿越:', //label
            ele: 'xd-new-transfer', //package 名称
            valueKey: 'xd-new-transfer', //form[valueKey]
            value: [
              {value: '1', label: '备选项 1'},
              {value: '2', label: '备选项 2'},
              4,5,6
            ], //v-model
            disabled: false,
            setting: {
              page_size: 10,
              height: 400
            },
            rules: [
              {required: true, message: '请输入运费满减规则金额，并且订单金额大于运费减金额。', trigger: 'blur'},
            ],
            handleCustom: ({action, data}) => {
              const generateData = (keyword, page_size, page_token)=> {
                console.log(keyword, page_size, page_token)
                const data = [];
                let i = (page_token-1) * page_size + 1;
                let len = (page_token - 1) * page_size + page_size;
                for (i; i <= len; i++) {
                  let label = `备选项 ${i}`;
                  if(keyword) label = `备选项【${keyword}】 ${i}`;
                  data.push({
                    value: `${i}`,
                    label: label,
                  });
                }
                return data;
              };

              if(action === 'onSearch') {
                let {keyword, page_size, page_token} = data.params;
                setTimeout(()=>{
                  data.cb({list: generateData(keyword, page_size, page_token), total: 30 })
                }, 10)
              }

              if(action === 'onInit') {
                console.log(data.params)
                setTimeout(() => {
                  data.cb({list:[
                    {value: 4, label: '备选项 4'},
                    {value: 5, label: '备选项 5'},
                    {value: 6, label: '备选项 6'},
                 ]})
                }, 1000)
              }
            },
          },
          {
            label: '满减规则:', //label
            ele: 'xd-full-cut-rule', //package 名称
            valueKey: 'cut-full-rule', //form[valueKey]
            value: [
              {exprss_full_price: 0, exprss_cut_price: 30},
              {exprss_full_price: 500, exprss_cut_price: 80},
              {exprss_full_price: 1000, exprss_cut_price: 0},
            ], //v-model
            disabled: false,
            useCustomRules: false,
            maps: {
              full_price: 'exprss_full_price',
              cut_price: 'exprss_cut_price'
            },
            rules: [
              {required: true, message: '请输入运费满减规则金额，并且订单金额大于运费减金额。', trigger: 'blur'},
            ]
          },
          {
            ele: 'title',
            label: '基础信息',
            size: 'mini',
          },
          //内容显示
          {
            ele: 'el-html',
            label: '基础信息',
            value: '基础信息',
          },
          {
            label: '', //label
            ele: 'slot', //package 名称
            slot: 'time',
          },
          {
            label: '选择网站路径:', //label
            ele: 'xd-select-site-path', //package 名称
            valueKey: 'select-site-path', //form[valueKey]
            value: {
              dir: "lc-mp-weixin-1",
              path: "/system/order/detail",
              host: "412xj13",
              site_id: '13102571a54f0767'
            },
            handleCustom: ({action, data}) =>{
              console.log('handleCustom',action, data);

              //获取应用列表
              if(action === 'appList') {
                let routerData = [];
                app.items.map(item=>{
                  console.log('routerData', item)
                  if(item['children']) {
                    routerData = routerData.concat(getEditPagesTreeToPathArr(
                      item['children'],
                      item['label'],
                      item['value'],
                      item['route'],
                    ))
                  }
                });
                data.cb(routerData)
              }

              if(action === 'siteList') {
                setTimeout(()=>{
                  data.cb(site.list.map(item=>{
                    return {
                      ...item,
                      label: item['site_name'],
                      value: item['site_id']
                    }
                  }))
                }, 1000)
              }
            },
            setting: {
              siteID: null, //
            },
            inline: false,
            notice: '如：设置16:00前下单，最早可提前2小时；16:00后下单，最早可提前1天。<br />若：用户在16点前下单，最早可选择当前下单时间往后2小时的时间；16点后下单，最早只能选择第2天。',
            rules: [
              {required: true, message: '请添加内容', trigger: 'change'},
            ],
          },
          {
            label: '选中路径:', //label
            ele: 'xd-select-pages-path', //package 名称
            valueKey: 'select-pages-path', //form[valueKey]
            value: null,
            setting: {
              router: getEditPagesTreeToPathArr(router.data)
            },
            inline: false,
            notice: '如：设置16:00前下单，最早可提前2小时；16:00后下单，最早可提前1天。<br />若：用户在16点前下单，最早可选择当前下单时间往后2小时的时间；16点后下单，最早只能选择第2天。',
            rules: [
              {required: true, message: '请添加内容', trigger: 'change'},
            ],
          },
          {
            label: '选择商品:', //label
            ele: 'xd-table-product', //package 名称
            valueKey: 'table-product', //form[valueKey]
            value: [
              {
                "id": "26",
                "package_name": "北京慈铭体检入职体检B",
                "price": "36000",
                "package_type": ["入职体检"],
                "updated": "2021-12-16",
                "created": "2021-12-17",
                "status": "Y",
                "image": 'https://jfbcake.oss-cn-beijing.aliyuncs.com/uploads/20200710/6e6e8d3be52ec622216e667620ee9634.jpg'
              },
              {
                "id": "27",
                "package_name": "廊坊大健康医院",
                "price": "72000",
                "package_type": ["老年体检"],
                "updated": "2021-12-17",
                "created": "2021-12-18",
                "status": "N",
                "image": 'https://jfbcake.oss-cn-beijing.aliyuncs.com/uploads/20200710/6e6e8d3be52ec622216e667620ee9634.jpg'
              },
              {
                "id": "28",
                "package_name": "廊坊大健康医院",
                "price": "76000",
                "package_type": ["儿童体检"],
                "updated": "2021-12-18",
                "created": "2021-12-19",
                "status": "Y",
                "image": 'https://jfbcake.oss-cn-beijing.aliyuncs.com/uploads/20200710/6e6e8d3be52ec622216e667620ee9634.jpg'
              }
            ],
            disabled: false,
            handleCustom: ({action, data}) => {

              //处理点击链接按钮跳转
              if (action === 'link') {
                return `/editor/editor`
              }

              if (action === 'button') {
                console.log(action, data)
              }

              //当前搜索记录中的某条记录是否在已选中列表中
              if (action === 'disabled') {
                return data.list.filter(item => {
                  return item.id === data.row.id;
                })
              }

              //搜索（搜索｜重置｜翻页）操作
              if (action === 'search') {
                console.log(data.params);
                let list = [1, 2, 3, 4, 5].map(item => {
                  return {
                    "id": item === 1 ? '26' : this.$xdHelper.random(1000, 999999),
                    "package_name": "北京慈铭体检入职体检B",
                    "price": this.$xdHelper.random(100000, 999999),
                    "package_type": ["入职体检"],
                    "updated": "2021-12-16",
                    "created": "2021-12-17",
                    "status": this.$xdHelper.random(1, 2) === 1 ? 'Y' : 'N',
                    "image": 'https://jfbcake.oss-cn-beijing.aliyuncs.com/uploads/20200710/6e6e8d3be52ec622216e667620ee9634.jpg'
                  }
                });
                setTimeout(() => {
                  data.cb({
                    total: this.$xdHelper.random(10, 50),
                    list: list
                  })
                }, 1000)
              }

              //选中操作
              if (action === 'select') {
                let list = data.list.map((item, index) => {
                  return {
                    "id": item.id,
                    "package_name": item.package_name,
                    "price": item.price,
                    "package_type": ["入职体检"],
                    "updated": `2021-12-${9 + index}`,
                    "created": `2021-12-${10 + index}`,
                    "status": index % 2 === 0 ? 'Y' : 'N',
                    "image": 'https://jfbcake.oss-cn-beijing.aliyuncs.com/uploads/20200710/6e6e8d3be52ec622216e667620ee9634.jpg'
                  }
                });
                data.cb(list)
              }

              //记录返回数据进行过滤处理
              if (action === 'remote-search') {
                console.log('remote-search', data, action)
                setTimeout(() => {
                  data.cb([
                    {label: '1111', value: 1 },
                    {label: '2222', value: 2 }
                  ])
                }, 1000)
              }

            },
            setting: {
              btnName: '指定商品',
              border: true,
              headers: [
                {type: 'normal', prop: 'id', align: 'center', minWidth: 100, label: 'ID'},
                {type: 'normal', sort: true, prop: 'package_name', align: 'center', minWidth: 200, label: '商品名称'},
                {type: 'image', sort: true, prop: 'image', align: 'center', width: 100, height: 100, label: 'icon'},
                {type: 'price', sort: true, prop: 'price', align: 'center', width: 200, label: '价格'},
                {type: 'tag', prop: 'package_type', align: 'center', width: 100, label: '类型'},
                {type: 'status', prop: 'status', align: 'center', width: 100, label: '状态', message: ['正常', '禁用']},
                {type: 'normal', sort: true, prop: 'updated', align: 'center', width: 150, label: '更新时间'},
                {type: 'normal', sort: true, prop: 'created', align: 'center', width: 150, label: '创建时间'},
                {
                  type: 'operate',
                  align: 'center',
                  prop: 'operate',
                  width: 130,
                  label: '操作',
                  values: [
                    {ui: 'text-link', name: '查看', type: 'primary', target: '_blank'},
                    {ui: 'text-button', name: '删除', type: 'danger', pos: 'delete'},
                  ]
                }
              ],
              searchForm: [
                {
                  label: '商品ID:', //label
                  ele: 'el-input', //package 名称
                  valueKey: 'id', //form[valueKey]
                  value: '', //v-model
                  placeholder: '请输入商品ID'
                },
                {
                  label: '供货商:',
                  ele: 'xd-select-remote',
                  valueKey: 'supplier_id',
                  value: '',
                  placeholder: '请选择供货商',
                  multiple: false,
                },
                {
                  label: '商品名称:', //label
                  ele: 'el-input', //package 名称
                  valueKey: 'order_id', //form[valueKey]
                  value: '', //v-model
                  placeholder: '请输入订商品名称'
                },
              ],
              width: '900px',
              maxHeight: '600px',
              title: '选择商品',
              selectList: testData,
            },
            rules: [
              {required: true, message: '请选择指定的商品。', trigger: 'change'},
            ],
            inline: false,
            notice: '如：设置16:00前下单，最早可提前2小时；16:00后下单，最早可提前1天。<br />若：用户在16点前下单，最早可选择当前下单时间往后2小时的时间；16点后下单，最早只能选择第2天。',
          },
          {
            label: '时间段选择:', //label
            ele: 'xd-day-range', //package 名称
            valueKey: 'xd-day-range', //form[valueKey]
            className: 'input50',
            placeholder: {
              start: '开始',
              end: '结束'
            },
            value: [],
            setting: {
              type: '每天',
              valueFormat: 'HH:mm',
              pickerOptions: {format: 'HH:mm'}
            },
            inline: false,
            notice: '如：设置16:00前下单，最早可提前2小时；16:00后下单，最早可提前1天。<br />若：用户在16点前下单，最早可选择当前下单时间往后2小时的时间；16点后下单，最早只能选择第2天。',
            rules: [
              {required: true, message: '请添加内容', trigger: 'change'},
            ],
          },
          {
            label: '自定义tags显示:', //label
            ele: 'xd-text-area-tag', //package 名称
            valueKey: 'xd-text-area-tag', //form[valueKey]
            className: 'input60',
            placeholder: '请输入手机号',
            value: [
              {label: 123444, value: 123444},
              {label: 15110208397, value: 15110208397}
            ],
            setting: {
              multiple: true
            },
            inline: false,
            notice: '如：设置16:00前下单，最早可提前2小时；16:00后下单，最早可提前1天。<br />若：用户在16点前下单，最早可选择当前下单时间往后2小时的时间；16点后下单，最早只能选择第2天。',
            rules: [
              {required: true, message: '请添加内容', trigger: 'change'},
            ],
          },
          {
            label: '订单类型设置:', //label
            ele: 'xd-order-setting', //package 名称
            valueKey: 'order-setting', //form[valueKey]
            value: {
              path: {value: '/index/index/index', label: '首页'},
              list: [
                {icon: "hghf", label: "已完成", size: "18", status: "4"}
              ]
            },
            needPath: true,
            setting: {
              router: getEditPagesTreeToPathArr(router.data),
              number: [
                {"label": "全部", "value": 'all'},
                {"label": "待付款", "value": '1'},
                {"label": "待收货", "value": '2'},
                {"label": "已取消", "value": '3'},
                {"label": "已完成", "value": '4'},
              ]
            },
            inline: false,
            notice: '如：设置16:00前下单，最早可提前2小时；16:00后下单，最早可提前1天。<br />若：用户在16点前下单，最早可选择当前下单时间往后2小时的时间；16点后下单，最早只能选择第2天。',
            rules: [
              {required: true, message: '请添加内容', trigger: 'change'},
            ],
          },
          {
            label: '底部配置:', //label
            ele: 'xd-footer-setting', //package 名称
            valueKey: 'footer-setting', //form[valueKey]
            defaultValue: null,
            value: [],
            setting: {
              router: getEditPagesTreeToPathArr(router.data),
              showField: {
                path: true,
                icon: true,
                notice: true
              }
            },
            handleCustom({action, data}) {
              let res = [
                {"label": "购物车消息", "value": "\/cms\/v1\/setting\/test_num\/test?value=0"},
                {"label": "系统消息", "value": "\/cms\/v1\/setting\/test_num\/test?value=1"},
                {"label": "聊天消息", "value": "\/cms\/v1\/setting\/test_num\/test?value=2"},
                {"label": "通知消息", "value": "\/cms\/v1\/setting\/test_num\/test?value=3"}
              ]
              data.cb(data)
            },
            inline: false,
            notice: '如：设置16:00前下单，最早可提前2小时；16:00后下单，最早可提前1天。<br />若：用户在16点前下单，最早可选择当前下单时间往后2小时的时间；16点后下单，最早只能选择第2天。',
            rules: [
              {required: true, message: '请添加内容', trigger: 'change'},
            ],
          },

          {
            label: '自定义Radio:', //label
            ele: 'xd-radio-custom', //package 名称
            valueKey: 'radio-custom', //form[valueKey]
            value: 1,
            disabled: true,
            setting: {
              list: [
                {value: 1, label: '实物商品', desc: '通过物流或<span class="red">自提方式</span>发货'},
                {value: 2, label: '电子票券', desc: '自动生成券码，到店核销'},
                {value: 3, label: '生活服务', desc: '自动生成券码，到店核销'},
                {value: 4, label: '线上显示', desc: '可提前2小时；16:00后下单，最早可提前1天'},
              ]
            },
            inline: false,
            notice: '如：设置16:00前下单，最早可提前2小时；16:00后下单，最早可提前1天。<br />若：用户在16点前下单，最早可选择当前下单时间往后2小时的时间；16点后下单，最早只能选择第2天。',
            rules: [
              {required: true, message: '请添加内容', trigger: 'change'},
            ],
          },
          {
            label: '商品参数:', //label
            ele: 'xd-product-params', //package 名称
            valueKey: 'product-params', //form[valueKey]
            value: [
              {
                "attr_id": "xI-1p0qSY1roS2Z5LxA-S",
                "name": "用户选择",
                "value": 'sed',
              },
              {
                "attr_id": "xI-1p0qSY1roS2Z5LxA-C",
                "name": "复选框",
                "value": ['Excepteur', 'sed'],
              },
              {
                "attr_id": "xI-1p0qSY1roS2Z5LxA-R",
                "name": "单选",
                "value": "女",
              },
              {
                "attr_id": "xI-1p0qSY1roS2Z5LxA-I",
                "name": "输入框",
                "value": "大师兄",
              },
              {
                "attr_id": "",
                "name": "key1",
                "value": "value1",
              },
              {
                "attr_id": "",
                "name": "key2",
                "value": "value2",
              },
            ],
            setting: {
              can_add_param: true,
              parameters: [
                {
                  "attr_id": "xI-1p0qSY1roS2Z5LxA-S",
                  "name": "用户选择",
                  "input_type": "SELECT",
                  "is_required": false,
                  "options": [
                    {
                      "label": "sed",
                      "value": "sed"
                    },
                    {
                      "label": "Excepteur",
                      "value": "Excepteur"
                    },
                    {
                      "label": "nostru",
                      "value": "nostru"
                    },
                    {
                      "label": "proident",
                      "value": "proident"
                    }
                  ],
                },
                {
                  "attr_id": "xI-1p0qSY1roS2Z5LxA-C",
                  "name": "复选框",
                  "input_type": "CHECKBOX",
                  "is_required": true,
                  "options": [
                    {
                      "label": "sed",
                      "value": "sed"
                    },
                    {
                      "label": "Excepteur",
                      "value": "Excepteur"
                    },
                    {
                      "label": "nostru",
                      "value": "nostru"
                    },
                    {
                      "label": "proident",
                      "value": "proident"
                    }
                  ],
                },
                {
                  "attr_id": "xI-1p0qSY1roS2Z5LxA-R",
                  "name": "单选",
                  "input_type": "RADIO",
                  "is_required": false,
                  "options": [
                    {
                      "label": "男",
                      "value": "男"
                    },
                    {
                      "label": "女",
                      "value": "女"
                    }
                  ],
                },
                {
                  "attr_id": "xI-1p0qSY1roS2Z5LxA-I",
                  "name": "输入框",
                  "input_type": "INPUT",
                  "is_required": false,
                },
              ]
            },
            inline: false,
            notice: '如：设置16:00前下单，最早可提前2小时；16:00后下单，最早可提前1天。<br />若：用户在16点前下单，最早可选择当前下单时间往后2小时的时间；16点后下单，最早只能选择第2天。',
            rules: [
              {required: true, message: '请添加内容', trigger: 'change'},
            ],
          },
          {
            label: '富文本:', //label
            ele: 'xd-tinymce', //package 名称
            valueKey: 'tinymce', //form[valueKey]
            value: '如：设置16:00前下单，最早可提前2小时；16:00后下单，最早可提前1天。<br />若：用户在16点前下单，最早可选择当前下单时间往后2小时的时间；16点后下单，最早只能选择第2天。',
            imageConfig: {
              sort: true,
              maxlen: 100,
              action: 'https://up-z1.qiniup.com',
              qiniuCdn: 'http://static.e56buy.com',
              size: 5,
              tipsformet: '上传文件格式：@imageType@，不超过@size@MB.',
              uploadType: 'qiniu', //aliyun , qiniu
              type: ['jpg', 'png', 'jpeg']
            },
            inline: false,
            notice: '如：设置16:00前下单，最早可提前2小时；16:00后下单，最早可提前1天。<br />若：用户在16点前下单，最早可选择当前下单时间往后2小时的时间；16点后下单，最早只能选择第2天。',
            rules: [
              {required: true, message: '请添加内容', trigger: 'change'},
            ],
          },

          {
            label: '远程选择树(input):', //label
            ele: 'xd-cascade-select', //package 名称
            valueKey: 'xd-cascade-select', //form[valueKey]
            //默认值
            value: ['22', '2016', '52607', '52622'], //v-model
            //value: ['22', '2016', '52607', ['52622', '52619', '52621']], //v-model
            disabled: false,
            multiple: false,
            //获取子集列表方法

            handleChildren: ({level, select, item}, resolve) => {
              let placeholder = '请选择省份';
              if (level === 1) placeholder = '请选择城市';
              if (level === 2) placeholder = '请选择县/市';
              if (level === 3) placeholder = '请选择乡/街道';
              axios({
                method: 'get',
                url: this.getCity,
                params: {
                  token: this.token,
                  parent_code: level === 0 ? 0 : select.value
                }
              })
                .then((res) => {
                  let temp = [];
                  res.data.result.map((item) => {
                    temp.push({...item, value: item['city_code'], label: item['name']});
                  });
                  resolve({
                    list: temp, //数据列表(必选)
                    isChildren: level < 3, //是否有子集(必选)
                    placeholder: placeholder, //占位符(必选)
                    custom: 1, //自定义字段
                    params: {a: 1, b: 2} //自定义字段
                  });
                  loading.close();
                  console.log('handleChildren', temp);
                })
                .catch((error) => {
                });
            },
            rules: [
              {required: true, message: '请添加数据', trigger: 'change'},
            ],
          },
          {
            label: '远程添加树(input):', //label
            ele: 'xd-remote-cascader', //package 名称
            valueKey: 'xd-remote-cascade', //form[valueKey]
            //默认值
            value: [{
              value: ['5', '258'],
              label: "河北/唐山市"
            }], //v-model
            disabled: false,
            multiple: true,
            //获取子集列表方法

            handleChildren: ({level, select, item}, resolve) => {
              let placeholder = '请选择省份';
              if (level === 1) placeholder = '请选择城市';
              if (level === 2) placeholder = '请选择县/市';
              if (level === 3) placeholder = '请选择乡/街道';
              axios({
                method: 'get',
                url: this.getCity,
                params: {
                  token: this.token,
                  parent_code: level === 0 ? 0 : select.value
                }
              })
                .then((res) => {
                  let temp = [];
                  res.data.result.map((item) => {
                    temp.push({...item, value: item['city_code'], label: item['name']});
                  });
                  resolve({
                    list: temp, //数据列表(必选)
                    isChildren: level < 3, //是否有子集(必选)
                    placeholder: placeholder, //占位符(必选)
                    custom: 1, //自定义字段
                    params: {a: 1, b: 2} //自定义字段
                  });
                  loading.close();
                  console.log('handleChildren', temp);
                })
                .catch((error) => {
                });
            },
            placeholder: '请添加数据',
            tips: '输入或选中操作后，请点击右侧"+"按钮进行添加操作',
            rules: [
              {required: true, message: '请添加数据', trigger: 'change'},
            ],
          },
          {
            label: '选项操作:', //label
            ele: 'xd-cascade', //package 名称
            valueKey: 'cascade', //form[valueKey]

            //单选模式传值
            value: ['yizhi'], //v-model

            //多选模式传值
            // value: [
            //   //{express_label: "指南", express_value: 'zhinan'},
            //   //{express_label: "导航", express_value: 'daohang'},
            //   {express_label: "一致", express_value: 'yizhi'},
            //   // {express_label: "资源", express_value: 'ziyuan'},
            // ], //v-model

            disabled: false,
            list: testData,
            className: 'input40',
            setting: {
              isBackLeaf: false,//是否只返回子节点
              isGeRoot: true, //当子集合选择返回父节点选
              filterable: true,
              clearable: true,
              collapseTags: true,
              multiple: false,
            },
            maps: {
              label: 'express_label',
              value: 'express_value'
            },
            rules: [
              {required: true, message: '请输入运费满减规则金额，并且订单金额大于运费减金额。', trigger: 'blur'},
            ],
            inline: false,
            notice: '如：设置16:00前下单，最早可提前2小时；16:00后下单，最早可提前1天。<br />若：用户在16点前下单，最早可选择当前下单时间往后2小时的时间；16点后下单，最早只能选择第2天。'
          },
          {
            label: '选中城市:', //label
            ele: 'xd-cascade-panel', //package 名称
            valueKey: 'cascade-panel', //form[valueKey]
            value: ['yizhi'], //v-model 单选模式传值

            //多选模式传值
            //value: [
            //{express_label: "指南", express_value: 'zhinan'},
            // {express_label: "导航", express_value: 'daohang'},
            // {express_label: "一致", express_value: 'yizhi'},
            // {express_label: "资源", express_value: 'ziyuan'},
            //],
            list: testData,
            disabled: false,
            setting: {
              isBackLeaf: false,//是否只返回子节点
              multiple: false,
              isGeRoot: true, //当子集合选择返回父节点选
              height: '260px',
              tips: '如：设置16:00前下单，最早可提前2小时；16:00后下单，最早可提前1天。<br />若：用户在16点前下单，最早可选择当前下单时间往后2小时的时间；16点后下单，最早只能选择第2天。'
            },
            maps: {
              label: 'express_label',
              value: 'express_value'
            },
            rules: [
              {required: true, message: '请输入运费满减规则金额，并且订单金额大于运费减金额。', trigger: 'blur'},
            ],
          },
          {
            label: '尺寸:', //label
            ele: 'xd-size', //package 名称
            valueKey: 'size', //form[valueKey]
            value: {
              height: 200,
              width: 750
            }, //v-model
            disabled: {
              wDisabled: true,
              hDisabled: false
            },
            setting: {
              height: null,
              width: 750,
            },
            placeholder: {},
            rules: [
              {required: true, message: '请设置广告位尺寸', trigger: 'change'},
            ],
          },
          {
            label: '边距:', //label
            ele: 'xd-margin-padding', //package 名称
            valueKey: 'margin', //form[valueKey]
            value: null, //v-model
            disabled: false,
            setting: {
              type: 'margin',
            },
            placeholder: '请设置边距值',
            rules: [
              {required: true, message: '请设置边距值', trigger: 'change'},
            ],
          },
          {
            label: '颜色:', //label
            ele: 'xd-color', //package 名称
            valueKey: 'color', //form[valueKey]
            value: null, //v-model
            disabled: false,
            setting: {
              showAlpha: false,
              isAlpha: false, //是否返回rgba值
            },
            placeholder: '请选择颜色值',
            rules: [
              {required: true, message: '请选择颜色值', trigger: 'change'},
            ],
          },

          {
            label: '选择城市:', //label
            ele: 'xd-table-cascade', //package 名称
            valueKey: 'table-cascade', //form[valueKey]
            value: [
              // {
              //   value: ['jfb1'],
              //   label: '北京/北京',
              //   product_num: 1,
              //   freight: 10000,
              //   regions: [
              //     {
              //       "value": "jfb1",
              //       "label": "北京/北京",
              //     }
              //   ]
              // },
              // {
              //   value: ['jfb4'], //
              //   label: '重庆',
              //   product_num: 1,
              //   freight: 18900,
              //   regions: [
              //     {
              //       "value": "jfb4",
              //       "label": "重庆",
              //     }
              //   ]
              // },
              {
                value: ['dingbudaohang'], //
                label: '指南/导航/顶部导航',
                product_num: 1,
                freight: 18900,
                regions: [
                  {
                    value: "dingbudaohang",
                    label: "指南/导航/顶部导航"
                  }
                ]
              },
              {
                value: ['shejiyuanze'], //
                label: '指南/设计原则',
                product_num: 1,
                freight: 18900,
                regions: [
                  {
                    value: "shejiyuanze",
                    label: "指南/设计原则",
                  }
                ]
              },
            ],
            disabled: false,
            handleCustom: ({action, data}) => {

              //处理点击链接按钮跳转
              if (action === 'link') {
                return `/editor/editor`
              }

              //选择城市操作
              if (action === 'select') {
                let value = [];
                let label = [];
                let list = data.list.map(item => {
                  value.push(item.value);
                  label.push(item.labelAll.join('/'));
                  return {
                    value: item.value,
                    label: item.labelAll.join('/'),
                  }
                });
                data.cb({
                  value,
                  label: label.join('，'),
                  regions: list,
                  freight: 0,
                  product_num: 0
                })
              }

              //记录返回数据进行过滤处理
              if (action === 'filter') {
                let list = data.filter(item => {
                  return Object.keys(item).filter(key => {
                    let temp = true;
                    //首件数量必须大于0
                    if (key === 'product_num' && Number(item[key]) === 0) temp = false;
                    //首件运费必须大于0
                    //if (key === 'freight' && Number(item[key]) === 0) temp = false;
                    return !temp;
                  }).length === 0;
                });
                if (list.length === data.length) return data;
                else return []
              }

            },
            setting: {
              btnName: '指定同城区域',
              border: true,
              isOne: false,
              headers: [
                //{type: 'normal', sort: true, prop: 'label', align: 'center', minWidth: 200, label: '可配送区域'},
                {type: 'tag', prop: 'regions', align: 'center', minWidth: 200, label: '可配送区域'},
                {type: 'input', prop: 'product_num', align: 'center', width: 100, label: '首件(个)'},
                {type: 'input', prop: 'freight', align: 'center', width: 100, label: '运费(元)', isPrice: true},
                {
                  type: 'operate',
                  align: 'center',
                  prop: 'operate',
                  minWidth: 200,
                  label: '操作',
                  values: [
                    {ui: 'text-button', name: '修改', type: 'primary'},
                    {ui: 'text-button', name: '删除', type: 'danger'},
                  ]
                }
              ],
              width: '600px',
              maxHeight: '400px',
              title: '选择同城配送区域',
              selectList: testData,
            },
            rules: [
              {required: true, message: '请选择同城配送区域。', trigger: 'change'},
            ],
            inline: false,
            notice: '如：设置16:00前下单，最早可提前2小时；16:00后下单，最早可提前1天。<br />若：用户在16点前下单，最早可选择当前下单时间往后2小时的时间；16点后下单，最早只能选择第2天。',
          },
          {
            label: '按价格:', //label
            ele: 'xd-input-range', //package 名称
            valueKey: 'input-range', //form[valueKey]
            value: { //v-model
              startA: 1,
              endA: 10,
              select: 1,
            },
            disabled: false,
            setting: {
              /**单位显示**/
              unit: '%',
              icon: 'xd_admin_iconfont xdicon_jiage',

              /**选择条件显示**/
              selectWidth: '110px',
              selectMultiple: false,
              selectPlaceholder: '请选择',
              select: [
                {"label": "分销价", "value": 1},
                {"label": "市场价", "value": 2},
              ],

            },
            rules: [
              {required: true, message: '输入的按价格规则不能为空。', trigger: 'change'},
            ],
            maps: {
              start: 'startA',
              end: 'endA',
              select: 'select'
            },
            notice: '市场价和分销价',
          },
          {
            label: '选中城市(懒):', //label
            ele: 'xd-remote-cascader-panel', //package 名称
            valueKey: 'remote-cascader-panel', //form[valueKey]
            //v-model
            value: [
              //{express_label: "北京", express_value: '1'},
              {express_label: "北京/北京", express_value: '1-jfb1'},
            ],
            disabled: false,
            maps: {
              label: 'express_label',
              value: 'express_value'
            },
            handleCustom: ({action, data}) => {

              //全选第一层时候进行过滤操作
              if (action === 'filter') {
                return data.value !== '0';
              }

              //获取数据树列表
              if (action === 'lazyLoad') this.getDataRegionList(data.node, data.resolve);
            },
            setting: {
              isInclude: true, //有包含关系提示
              allSelectName: '全部省/市',
              height: '260px',
              multiple: true,
              tips: '如：设置16:00前下单，最早可提前2小时；16:00后下单，最早可提前1天。<br />若：用户在16点前下单，最早可选择当前下单时间往后2小时的时间；16点后下单，最早只能选择第2天。'
            },
            rules: [
              {required: true, message: '请输入运费满减规则金额，并且订单金额大于运费减金额。', trigger: 'change'},
            ]
          },
          {
            label: '输入有单位:', //label
            ele: 'xd-input-unit', //package 名称
            valueKey: 'input-unit', //form[valueKey]

            /**单位设置默认值**/
            value: { //v-model
              inputA: 20,
              unitA: 1
            },
            /**单位显示**/
            //value: 12,
            disabled: false,
            setting: {
              /**单位显示**/
              // unit: '%',
              // pos: 'append',
              // type: 'number',
              // tips: '深圳万利达移动通信设备有限公司',
              // width: '150px',
              // before: '最长',

              /**单位选则**/
              select: [
                {"label": "小时", "value": 1},
                {"label": "分钟", "value": 2},
              ],
              pos: 'append',
              tips: '深圳万利达移动通信设备有限公司',
              type: 'number',
              width: '200px',
              selectWidth: "80px",
              before: '最长',

            },
            rules: [
              {required: true, message: '请输入运费满减规则金额，并且订单金额大于运费减金额。', trigger: 'blur'},
              // {
              //   required: true, validator(a, b) {
              //     console.log('validator', b)
              //   }
              // },
            ],
            maps: {
              input: 'inputA',
              unit: 'unitA'
            },
          },
          {
            notice: '深圳万利达移动通信设备有限公司',
            inline: true,
            label: '域名名称:', //label
            ele: 'el-input', //package 名称
            type: 'text',
            valueKey: 'domain_name', //form[valueKey]
            value: '1111', //v-model
            placeholder: '输入域名名称',
            className: 'input40',
            rules: [
              {required: true, message: '请输入域名地址', trigger: 'blur'},
            ]
          },
          {
            label: '', //label
            ele: 'slot', //package 名称
            slot: 'form',
          },
          {
            label: '', //label
            ele: 'slot', //package 名称
            slot: 'full',
          },
          {
            label: '', //label
            ele: 'slot', //package 名称
            slot: 'full2',
          },
        ],
        formListTest2: [
          {
            label: '满减规则2:', //label
            ele: 'xd-full-cut-rule', //package 名称
            valueKey: 'cut-full-rule2', //form[valueKey]
            value: [
              {exprss_full_price: 200, exprss_cut_price: 30},
              {exprss_full_price: 500, exprss_cut_price: 80},
              {exprss_full_price: 1000, exprss_cut_price: 300},
            ], //v-model
            disabled: false,
            useCustomRules: false,
            maps: {
              full_price: 'exprss_full_price',
              cut_price: 'exprss_cut_price'
            },
            rules: [
              {required: true, message: '请输入运费满减规则金额，并且订单金额大于运费减金额。', trigger: 'blur'},
            ]
          },
        ],
        formListTest3: [
          {
            label: '满减规则3:', //label
            ele: 'xd-full-cut-rule', //package 名称
            valueKey: 'cut-full-rule3', //form[valueKey]
            value: [
              {exprss_full_price: 200, exprss_cut_price: 30},
              {exprss_full_price: 500, exprss_cut_price: 80},
              {exprss_full_price: 1000, exprss_cut_price: 300},
            ], //v-model
            disabled: false,
            useCustomRules: false,
            maps: {
              full_price: 'exprss_full_price',
              cut_price: 'exprss_cut_price'
            },
            rules: [
              {required: true, message: '请输入运费满减规则金额，并且订单金额大于运费减金额。', trigger: 'blur'},
            ]
          },
        ],

        formList: [
          //时间区间插件
          {
            label: '活动时间:', //label
            ele: 'xd-date-range', //package 名称
            valueKey: ['start_range_time', 'end_range_time'], //form[valueKey]
            value: [1672047551, 1679047551], //v-model timestamp=>必须时间戳 毫秒
            format: 'yyyy/MM/dd HH:mm:ss',//时间显示格式
            formatValue: 'timestamp', //输出时间格式
            placeholder: ['活动开始时间', '活动结束时间'],
            isShowPickerOptionsFast: false, //显示快捷方式
            //filterPassTime: true, //使用过去时间
            //filterFutureTime: true, //使用未来时间
            filterRange:[new Date().getTime() - (30 * 24 * 60 * 60 * 1000), new Date().getTime() + (30*24*60*60*1000)], //使用时间段
          },

          //时间插件
          {
            label: '开启时间:', //label
            ele: 'xd-date', //package 名称
            valueKey: 'open_time', //form[valueKey]
            value: 1679618945, //v-model timestamp=>必须时间戳 毫秒
            format: 'yyyy/MM/dd HH:mm:ss',//时间显示格式
            formatValue: 'timestamp', //输出时间格式
            placeholder: '开启时间',
            //filterPassTime: true, //使用过去时间
            //filterFutureTime: true, //使用未来时间
            filterRange: [new Date().getTime() - (30 * 24 * 60 * 60 * 1000), new Date().getTime() + (30 * 24 * 60 * 60 * 1000)], //使用时间段
            rules: [
              {required: true, message: '请输入时间', trigger: ['blur', 'change']}
            ]
          },

          //选择礼拜日与时间插件
          {
            label: '选择礼拜:', //label
            ele: 'xd-select-week-time', //package 名称
            valueKey: {list: 'week_day', time: ['week_start', 'week_end']}, //form[valueKey]
            defaultValue: {list: [], time: []}, //默认图片对象
            list: [
              {label: '日', value: 0},
              {label: "一", value: 1},
              {label: "二", value: 2},
              {label: "三", value: 3},
              {label: "四", value: 4},
              {label: "五", value: 5},
              {label: "六", value: 6}
            ],
            rules: [
              {required: true, message: '请选择日期', trigger: ['blur', 'change']},
              {
                validator: (rule, value, callback) => {
                  console.log('1111', value);
                  callback()
                }, message: '请选择日期', trigger: ['blur', 'change']
              }
            ]
          },

          //区间输入
          {
            label: '卡号区间:', //label
            ele: 'xd-range', //package 名称
            valueKey: ['start_card', 'end_card'], //form[valueKey]
            value: [200, 300], //v-model
            placeholder: ['开始卡号', '结束卡号'],
            width: 450
          },

          {
            label: '配送预约:', //label
            ele: 'xd-express-reservation', //package 名称
            valueKey: 'express-reservation', //form[valueKey]
            value: null, //v-model
            disabled: false,
            //配置信息
            options: {},
            rules: [
              {required: true, message: '请输入域名地址', trigger: 'blur'},
            ]
          },

          //XdOverAddPrice
          {
            label: '超过:', //label
            ele: 'xd-over-add-price', //package 名称
            valueKey: {min: 'price_min', list: 'price_type', value: 'price'}, //form[valueKey]
            defaultValue: {min: '', list: '', value: ''}, //默认图片对象
            list: [
              {label: "加价", value: "raise"},
              {label: "下调", value: "reduce"},
              {label: "固定值", value: "fixed"}
            ],
            // rules: [
            //   // {required: true, message: '请输入规则', trigger: ['blur', 'change']},
            //   {}
            // ]
          },

          //input
          {
            label: '域名名称:', //label
            ele: 'el-input', //package 名称
            //text，textarea 和其他 原生 input 的 type 值
            //https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types
            type: 'text',
            valueKey: 'domain_name', //form[valueKey]
            value: '', //v-model
            placeholder: '输入域名名称',
            classNmae: 'input40', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
            rules: [
              {required: true, message: '请输入域名地址', trigger: 'blur'},
            ]
          },

          //多选选择
          {
            label: '选择模式:', //label
            ele: 'xd-check', //package 名称
            valueKey: 'check_name', //form[valueKey]
            value: [4, 5], //v-model
            list: [
              {"label": "万利达集团", "value": 4},
              {"label": "中国联通", "value": 5},
              {"label": "中国移动", "value": 6},
              {"label": "味多美", "value": 7},
            ],
            rules: [
              {required: true, message: '请选择模式', trigger: ['blur', 'change']},
            ]
          },

          //upload-one（用于文件上传）
          {
            label: '图片上传:', //label
            ele: 'xd-upload', //package 名称
            valueKey: 'upload-one-1', //form[valueKey]
            value: {}, //v-model
            defaultValue: null, //默认图片对象
            slot: false, //按钮是否使用slot
            elinputClassName: 'input40',
            tipsformet: '上传文件格式：@imageType@，不超过@size@MB.',
            type: ['jpg', 'png', 'jpeg'],
            styleType: 'one', //其值：one=>单文件上传 auth=>证件正反面上传 list=>多文件上传
            uploadType: 'qiniu', //''=>API服务上传  qiniu=>七牛云OSS上传  aliyun=> 阿里云OSS上传
            size: 5, //5M
            action: 'https://up-z1.qiniup.com',
            qiniuCdn: 'http://static.e56buy.com', //七牛访问资源域名
            sort: true, //当上传图片列表时候，是否启用排序
            maxlen: 100, //当上传图片列表时候，最大数量数量
            rules: [
              {required: true, message: '请上传图片', trigger: ['blur', 'change']},
            ]
          },

          //upload-one（用于图片icon上传）
          {
            label: '图片上传:', //label
            ele: 'xd-upload', //package 名称
            valueKey: 'upload-one-2', //form[valueKey]
            value: {}, //v-model
            defaultValue: null, //默认图片对象
            slot: true, //按钮是否使用slot
            elinputClassName: 'input40',
            tipsformet: '上传文件格式：@imageType@，不超过@size@MB.',
            type: ['jpg', 'png', 'jpeg'],
            styleType: 'one', //其值：one=>单文件上传 auth=>证件正反面上传 list=>多文件上传
            uploadType: 'qiniu', //''=>API服务上传  qiniu=>七牛云OSS上传  aliyun=> 阿里云OSS上传
            size: 5, //5M
            action: 'https://up-z1.qiniup.com',
            qiniuCdn: 'http://static.e56buy.com', //七牛访问资源域名
            sort: true, //当上传图片列表时候，是否启用排序
            maxlen: 100, //当上传图片列表时候，最大数量数量
            rules: [
              {required: true, message: '请上传图片', trigger: ['blur', 'change']},
            ]
          },

          //upload-auth
          {
            label: '证件上传:', //label
            ele: 'xd-upload', //package 名称
            valueKey: 'upload_auth', //form[valueKey]
            value: '', //v-model
            defaultValue: [], //默认图片对象
            slot: true, //按钮是否使用slot
            elinputClassName: 'input40',
            tipsformet: '上传文件格式：@imageType@，不超过@size@MB.',
            type: ['jpg', 'png', 'jpeg'],
            styleType: 'auth', //其值：one=>单文件上传 auth=>证件正反面上传 list=>多文件上传
            uploadType: 'qiniu', //''=>API服务上传  qiniu=>七牛云OSS上传  aliyun=> 阿里云OSS上传
            size: 5, //5M
            action: 'https://up-z1.qiniup.com',
            qiniuCdn: 'http://static.e56buy.com', //七牛访问资源域名
            sort: true, //当上传图片列表时候，是否启用排序
            maxlen: 100, //当上传图片列表时候，最大数量数量
            rules: [
              {required: true, message: '请上传图片', trigger: ['blur', 'change']},
            ]
          },

          //upload-list
          {
            label: '图片列表:', //label
            ele: 'xd-upload', //package 名称
            valueKey: 'upload_list', //form[valueKey]
            value: '', //v-model
            defaultValue: [
              {
                url: "http://static.e56buy.com/XdimdSPQr7QhSVoKJ4N9FuOTCumEbXdN",
                name: "1_1529482049654c8715a20-aafa-4a86-919e-9ec37af1eb3c.jpeg",
                uid: 1639020778679,
                hashKey: "XdimdSPQr7QhSVoKJ4N9FuOTCumEbXdN",
              }
            ], //默认图片对象
            slot: true, //按钮是否使用slot
            elinputClassName: 'input40',
            tipsformet: '上传文件格式：@imageType@，不超过@size@MB.',
            type: ['jpg', 'png', 'jpeg'],
            styleType: 'list', //其值：one=>单文件上传 auth=>证件正反面上传 list=>多文件上传
            uploadType: 'qiniu', //''=>API服务上传  qiniu=>七牛云OSS上传  aliyun=> 阿里云OSS上传
            size: 5, //5M
            action: 'https://up-z1.qiniup.com',
            qiniuCdn: 'http://static.e56buy.com', //七牛访问资源域名
            sort: true, //当上传图片列表时候，是否启用排序
            maxlen: 100, //当上传图片列表时候，最大数量数量
            rules: [
              {required: true, message: '请上传图片', trigger: ['blur', 'change']},
            ]
          },

          //多选选择
          {
            label: '项目分类:', //label
            ele: 'xd-select-list', //package 名称
            valueKey: 'project_name', //form[valueKey]
            value: [4, 5], //v-model
            placeholder: '请选择加盟商',
            multiple: true, //多选
            list: [
              {"label": "万利达集团", "value": 4},
              {"label": "中国联通", "value": 5},
              {"label": "中国移动", "value": 6},
              {"label": "味多美", "value": 7},
            ]
          },

          //单选选择
          {
            label: '加盟商:', //label
            ele: 'xd-select-list', //package 名称
            valueKey: 'product_type', //form[valueKey]
            value: 5, //v-model
            placeholder: '请选择加盟商',
            multiple: false,
            list: [
              {"label": "万利达集团", "value": 4},
              {"label": "中国联通", "value": 5},
              {"label": "中国移动", "value": 6},
              {"label": "味多美", "value": 7},
            ]
          },

          //状态选择
          {
            label: '状态:', //label
            ele: 'xd-select-status', //package 名称
            valueKey: 'status', //form[valueKey]
            value: 'Y', //v-model
            isAll: true,
            backValueType: 1, //返回值类型 1=>返回（Y,N）2=> [true|false] 3=>[1,0] 4=>[1,2]
            placeholder: '请选择',
            list: 'status', //status=>状态  best=>推荐  associate=>关联 yes=>是否 open=> 是否开启  check=>审核
          },

          {
            label: '状态(二选一):', //label
            ele: 'xd-radio-status', //package 名称
            valueKey: 'radio_status', //form[valueKey]
            value: 'Y', //v-model
            isall: true,
            backValueType: '', //返回值类型 1=>返回（Y,N）2=> [true|false] 3=>[1,0] 4=>[1,2]
            placeholder: '请选择',
            list: 'status', //status=>状态  best=>推荐  associate=>关联 yes=>是否 open=> 是否开启  check=>审核
          },

          {
            label: '单选列表:', //label
            ele: 'xd-radio', //package 名称
            valueKey: 'radio_status_list', //form[valueKey]
            value: 6, //v-model
            rules: [
              {required: true, message: '请选择', trigger: ['blur', 'change']}
            ],
            list: [
              {"label": "万利达集团", "value": 4},
              {"label": "中国联通", "value": 5},
              {"label": "中国移动", "value": 6},
              {"label": "味多美", "value": 7},
            ]
          },

          //Switch
          {
            label: 'Switch:', //label
            ele: 'xd-switch', //package 名称
            valueKey: 'switch_status_tips', //form[valueKey]
            value: 'Y', //v-model
            list: ['否', '是'], //左右文本
            color: ['green', '#999'], //文本颜色
            showTips: true, //是否显示文本
            backValueType: 1, //返回值类型 1=>返回（Y,N）2=> [true|false] 3=>[1,0] 4=>[1,2]
          },

          //Switch
          {
            label: 'Switch:', //label
            ele: 'xd-switch', //package 名称
            valueKey: 'switch_status', //form[valueKey]
            value: 'Y', //v-model
            list: ['否', '是'], //左右文本
            //color: ['green', '#999'], //文本颜色
            showTips: false, //是否显示文本
            backValueType: 1, //返回值类型 1=>返回（Y,N）2=> [true|false] 3=>[1,0] 4=>[1,2]
          },

          //插槽
          {
            label: '', //label
            ele: 'slot', //package 名称
            slot: 'time',
          },

          //Transfer
          {
            label: 'Transfer:', //label
            ele: 'xd-transfer', //package 名称
            valueKey: 'transfer', //form[valueKey]
            value: [], //v-model
            placeholder: '输入城市名称',
            title: ['Source', 'Target'],
            left: [], //左侧选中值
            right: [], //右边选中值
            list: null, //[] => 数组列表 null=>使用测试数据
            rules: [
              {required: true, message: '请选择穿越的值', trigger: ['blur', 'change']},
            ]
          },

        ],

        //Table Form
        tableFormList: [
          [
            {
              label: '老人姓名:', //label
              ele: 'el-input', //package 名称
              type: 'text',
              valueKey: 'oldProsion', //form[valueKey]
              value: '', //v-model
              placeholder: '输入老人姓名',
              rules: [
                {required: true, message: '输入老人姓名', trigger: 'blur'},
              ]
            },
            {
              label: '身份证号码:', //label
              ele: 'el-input', //package 名称
              type: 'text',
              valueKey: 'noNumber', //form[valueKey]
              value: '', //v-model
              placeholder: '输入身份证号码',
              rules: [
                {required: true, message: '输入身份证号码', trigger: 'blur'},
              ]
            },
            {
              label: '性别:', //label
              ele: 'xd-select-list', //package 名称
              valueKey: 'sex', //form[valueKey]
              value: '', //v-model
              placeholder: '请选择性别',
              list: [
                {"label": "男", "value": 1},
                {"label": "女", "value": 2}
              ],
              rules: [
                {required: true, message: '请选择性别', trigger: 'change'},
              ]
            },
            {
              label: '图片上传:', //label
              ele: 'xd-upload', //package 名称
              valueKey: 'upload', //form[valueKey]
              value: {}, //v-model
              defaultValue: null, //默认图片对象
              slot: true, //按钮是否使用slot
              oneWidth: 102,//单个图片显示宽度
              oneHeight: 141, //单个图片显示高度
              elinputClassName: 'input40',
              tipsformet: '上传文件格式：@imageType@，不超过@size@MB.',
              type: ['jpg', 'png', 'jpeg'],
              styleType: 'one', //其值：one=>单文件上传 auth=>证件正反面上传 list=>多文件上传
              uploadType: 'qiniu', //''=>API服务上传  qiniu=>七牛云OSS上传  aliyun=> 阿里云OSS上传
              size: 5, //5M
              action: 'https://up-z1.qiniup.com',
              qiniuCdn: 'http://static.e56buy.com', //七牛访问资源域名
              sort: true, //当上传图片列表时候，是否启用排序
              maxlen: 100, //当上传图片列表时候，最大数量数量
              rowspan: 3,
              rules: [
                {required: true, message: '请上传图片', trigger: ['blur', 'change']},
              ]
            },
          ],
          [
            {
              label: '老人姓名:', //label
              ele: 'el-input', //package 名称
              type: 'text',
              valueKey: 'oldProsion', //form[valueKey]
              value: '', //v-model
              placeholder: '输入老人姓名',
              rules: [
                {required: true, message: '输入老人姓名', trigger: 'blur'},
              ]
            },
            {
              label: '身份证号码:', //label
              ele: 'el-input', //package 名称
              type: 'text',
              valueKey: 'noNumber', //form[valueKey]
              value: '', //v-model
              placeholder: '输入身份证号码',
              rules: [
                {required: true, message: '输入身份证号码', trigger: 'blur'},
              ]
            },
            {
              label: '性别:', //label
              ele: 'xd-select-list', //package 名称
              valueKey: 'sex', //form[valueKey]
              value: '', //v-model
              placeholder: '请选择性别',
              list: [
                {"label": "男", "value": 1},
                {"label": "女", "value": 2}
              ],
              rules: [
                {required: true, message: '请选择性别', trigger: 'change'},
              ]
            },
          ],
          [
            {
              label: '老人姓名:', //label
              ele: 'el-input', //package 名称
              type: 'text',
              valueKey: 'oldProsion', //form[valueKey]
              value: '', //v-model
              placeholder: '输入老人姓名',
              rules: [
                {required: true, message: '输入老人姓名', trigger: 'blur'},
              ]
            },
            {
              label: '身份证号码:', //label
              ele: 'el-input', //package 名称
              type: 'text',
              valueKey: 'noNumber', //form[valueKey]
              value: '', //v-model
              placeholder: '输入身份证号码',
              rules: [
                {required: true, message: '输入身份证号码', trigger: 'blur'},
              ]
            },
            {
              label: '性别:', //label
              ele: 'xd-select-list', //package 名称
              valueKey: 'sex', //form[valueKey]
              value: '', //v-model
              placeholder: '请选择性别',
              list: [
                {"label": "男", "value": 1},
                {"label": "女", "value": 2}
              ],
              rules: [
                {required: true, message: '请选择性别', trigger: 'change'},
              ]
            },
          ],
          [
            {
              label: '老人姓名:', //label
              ele: 'el-input', //package 名称
              type: 'text',
              valueKey: 'oldProsion', //form[valueKey]
              value: '', //v-model
              placeholder: '输入老人姓名',
              colspan: 7,
              rules: [
                {required: true, message: '输入老人姓名', trigger: 'blur'},
              ]
            },
          ],
          [
            {
              label: '老人姓名:', //label
              ele: 'el-input', //package 名称
              type: 'text',
              valueKey: 'oldProsion', //form[valueKey]
              value: '', //v-model
              placeholder: '输入老人姓名',
              colspan: 3,
              rules: [
                {required: true, message: '输入老人姓名', trigger: 'blur'},
              ]
            },
            {
              label: '身份证号码:', //label
              ele: 'el-input', //package 名称
              type: 'text',
              valueKey: 'noNumber', //form[valueKey]
              value: '', //v-model
              placeholder: '输入身份证号码',
              colspan: 3,
              rules: [
                {required: true, message: '输入身份证号码', trigger: 'blur'},
              ]
            },
          ],
          [
            {
              label: '紧急联系人',
              ele: 'el-title',
              colspan: 8,
            }
          ],
          [
            {
              label: '老人姓名:', //label
              ele: 'el-input', //package 名称
              type: 'text',
              valueKey: 'oldProsion', //form[valueKey]
              value: '', //v-model
              placeholder: '输入老人姓名',
              colspan: 3,
              rules: [
                {required: true, message: '输入老人姓名', trigger: 'blur'},
              ]
            },
            {
              label: '身份证号码:', //label
              ele: 'el-input', //package 名称
              type: 'text',
              valueKey: 'noNumber', //form[valueKey]
              value: '', //v-model
              placeholder: '输入身份证号码',
              colspan: 3,
              rules: [
                {required: true, message: '输入身份证号码', trigger: 'blur'},
              ]
            },
          ],
          [
            {
              label: '卡号区间:', //label
              ele: 'xd-range', //package 名称
              valueKey: ['start_card', 'end_card'], //form[valueKey]
              value: [200, 300], //v-model
              placeholder: ['开始卡号', '结束卡号'],
              width: 300,
              colspan: 3,
            },
            {
              label: '活动时间:', //label
              ele: 'xd-date-range', //package 名称
              valueKey: ['start_range_time', 'end_range_time'], //form[valueKey]
              value: [1636128000000, 1638720000000], //v-model timestamp=>必须时间戳 毫秒
              format: 'yyyy/MM/dd HH:mm:ss',//时间显示格式
              formatValue: 'timestamp', //输出时间格式
              placeholder: ['活动开始时间', '活动结束时间'],
              isShowPickerOptionsFast: true,
              colspan: 3,
              rules: [
                {required: true, message: '请选择日期', trigger: ['blur', 'change']},
              ]
            },
          ],
          [
            {
              label: '开启时间:', //label
              ele: 'xd-date', //package 名称
              valueKey: 'open_time', //form[valueKey]
              value: 1636128000000, //v-model timestamp=>必须时间戳 毫秒
              format: 'yyyy/MM/dd HH:mm:ss',//时间显示格式
              formatValue: 'timestamp', //输出时间格式
              placeholder: '开启时间',
              colspan: 3,
              rules: [
                {required: true, message: '请输入时间', trigger: ['blur', 'change']}
              ]
            },
            {
              label: '活动时间:', //label
              ele: 'xd-date-range', //package 名称
              valueKey: ['start_range_time', 'end_range_time'], //form[valueKey]
              value: [1636128000000, 1638720000000], //v-model timestamp=>必须时间戳 毫秒
              format: 'yyyy/MM/dd HH:mm:ss',//时间显示格式
              formatValue: 'timestamp', //输出时间格式
              placeholder: ['活动开始时间', '活动结束时间'],
              colspan: 1,
              rules: [
                {required: true, message: '请选择日期', trigger: ['blur', 'change']},
              ]
            },
            {
              label: 'Switch:', //label
              ele: 'xd-switch', //package 名称
              valueKey: 'switch_status', //form[valueKey]
              value: 'Y', //v-model
              list: ['否', '是'], //左右文本
              disabled: true,
              //color: ['green', '#999'], //文本颜色
              showTips: false, //是否显示文本
              backValueType: 1, //返回值类型 1=>返回（Y,N）2=> [true|false] 3=>[1,0] 4=>[1,2]
              colspan: 1,
            },
          ],

          [
            {
              label: '单选列表:', //label
              ele: 'xd-radio', //package 名称
              valueKey: 'radio_status_list', //form[valueKey]
              value: 6, //v-model
              rules: [
                {required: true, message: '请选择', trigger: ['blur', 'change']}
              ],
              list: [
                {"label": "万利达集团", "value": 4},
                {"label": "中国联通", "value": 5},
                {"label": "中国移动", "value": 6},
                {"label": "味多美", "value": 7},
                {"label": "万利达集团", "value": 8},
                {"label": "中国联通", "value": 9},
                {"label": "中国移动", "value": 1},
                {"label": "味多美", "value": 2},
                {"label": "万利达集团", "value": 3},
                {"label": "中国联通", "value": 10},
                {"label": "中国移动", "value": 11},
                {"label": "味多美", "value": 13},
              ],
              colspan: 3,
            },
            {
              label: '单选列表:', //label
              ele: 'xd-radio', //package 名称
              valueKey: 'radio_status_list', //form[valueKey]
              value: 6, //v-model
              rules: [
                {required: true, message: '请选择', trigger: ['blur', 'change']}
              ],
              list: [
                {"label": "万利达集团", "value": 4},
                {"label": "中国联通", "value": 5},
                {"label": "中国移动", "value": 6},
                {"label": "味多美", "value": 7},
                {"label": "万利达集团", "value": 8},
                {"label": "中国联通", "value": 9},
                {"label": "中国移动", "value": 1},
                {"label": "味多美", "value": 2},
                {"label": "万利达集团", "value": 3},
                {"label": "中国联通", "value": 10},
                {"label": "中国移动", "value": 11},
                {"label": "味多美", "value": 13},
              ],
              colspan: 3,
            }
          ],
          [
            {
              label: '选择模式:', //label
              ele: 'xd-check', //package 名称
              valueKey: 'check_name', //form[valueKey]
              value: [4, 5], //v-model
              list: [
                {"label": "万利达集团", "value": 1},
                {"label": "中国联通", "value": 2},
                {"label": "中国移动", "value": 3},
                {"label": "味多美", "value": 4},
                {"label": "万利达集团", "value": 5},
                {"label": "中国联通", "value": 6},
                {"label": "中国移动", "value": 7},
                {"label": "味多美", "value": 8},
                {"label": "万利达集团", "value": 9},
                {"label": "中国联通", "value": 10},
                {"label": "中国移动", "value": 11},
                {"label": "味多美", "value": 12},
              ],
              rules: [
                {required: true, message: '请选择模式', trigger: ['blur', 'change']},
              ],
              colspan: 3,
            },
            {
              label: '选择模式:', //label
              ele: 'xd-check', //package 名称
              valueKey: 'check_name', //form[valueKey]
              value: [4, 5], //v-model
              list: [
                {"label": "万利达集团", "value": 1},
                {"label": "中国联通", "value": 2},
                {"label": "中国移动", "value": 3},
                {"label": "味多美", "value": 4},
                {"label": "万利达集团", "value": 5},
                {"label": "中国联通", "value": 6},
                {"label": "中国移动", "value": 7},
                {"label": "味多美", "value": 8},
                {"label": "万利达集团", "value": 9},
                {"label": "中国联通", "value": 10},
                {"label": "中国移动", "value": 11},
                {"label": "味多美", "value": 12},
              ],
              rules: [
                {required: true, message: '请选择模式', trigger: ['blur', 'change']},
              ],
              colspan: 3,
            },
          ],
          [
            {
              label: '状态:', //label
              ele: 'xd-select-status', //package 名称
              valueKey: 'status', //form[valueKey]
              value: 'Y', //v-model
              isall: true,
              disabled: true,
              backValueType: '', //返回值类型 1=>返回（Y,N）2=> [true|false] 3=>[1,0] 4=>[1,2]
              placeholder: '请选择',
              list: 'status', //status=>状态  best=>推荐  associate=>关联 yes=>是否 open=> 是否开启  check=>审核
            },
            {
              label: '状态(二选一):', //label
              ele: 'xd-radio-status', //package 名称
              valueKey: 'radio_status', //form[valueKey]
              value: 'Y', //v-model
              isall: true,
              disabled: true,
              backValueType: '', //返回值类型 1=>返回（Y,N）2=> [true|false] 3=>[1,0] 4=>[1,2]
              placeholder: '请选择',
              list: 'status', //status=>状态  best=>推荐  associate=>关联 yes=>是否 open=> 是否开启  check=>审核
            },
            {
              label: '状态:', //label
              ele: 'xd-select-status', //package 名称
              valueKey: 'status', //form[valueKey]
              value: 'Y', //v-model
              isall: true,
              disabled: true,
              backValueType: '', //返回值类型 1=>返回（Y,N）2=> [true|false] 3=>[1,0] 4=>[1,2]
              placeholder: '请选择',
              list: 'status', //status=>状态  best=>推荐  associate=>关联 yes=>是否 open=> 是否开启  check=>审核
            },
            {
              label: '状态(二选一):', //label
              ele: 'xd-radio-status', //package 名称
              valueKey: 'radio_status', //form[valueKey]
              value: 'Y', //v-model
              isall: true,
              disabled: true,
              backValueType: '', //返回值类型 1=>返回（Y,N）2=> [true|false] 3=>[1,0] 4=>[1,2]
              placeholder: '请选择',
              list: 'status', //status=>状态  best=>推荐  associate=>关联 yes=>是否 open=> 是否开启  check=>审核
            },
          ]
        ],
        tableWidth: [110, 200, 110, 200, 110, 200, 110, 200],


        //远程搜索
        testResult: ["Alabama", "Alaska", "Arizona",
          "Arkansas", "California", "Colorado",
          "Connecticut", "Delaware", "Florida",
          "Georgia", "Hawaii", "Idaho", "Illinois",
          "Indiana", "Iowa", "Kansas", "Kentucky",
          "Louisiana", "Maine", "Maryland",
          "Massachusetts", "Michigan", "Minnesota",
          "Mississippi", "Missouri", "Montana",
          "Nebraska", "Nevada", "New Hampshire",
          "New Jersey", "New Mexico", "New York",
          "North Carolina", "North Dakota", "Ohio",
          "Oklahoma", "Oregon", "Pennsylvania",
          "Rhode Island", "South Carolina",
          "South Dakota", "Tennessee", "Texas",
          "Utah", "Vermont", "Virginia",
          "Washington", "West Virginia", "Wisconsin",
          "Wyoming"],
        testResultList: [],

      }
    },
    watch: {
      XdBaseFieldValue(value) {
        console.log('XdBaseFieldValue', value)
      }
    },

    created() {
      this.testResultList = this.testResult.map(item => {
        return {value: `value:${item}`, label: `label:${item}`};
      });
    },


    methods: {

      handleImage(){
        const setup = {useCORS: true}; // 使用跨域};
        html2canvas(document.getElementById('test-cav'), setup)
          .then((canvas) => {
            var dataURL = canvas.toDataURL("image/png");
            downloadJs(dataURL, 'test');
          })
          .catch();
      },

      /**
       * @description 获取配送区域
       * @param node 上级城市对象
       * @param resolve 回调地址
       */
      getDataRegionList(node, resolve) {
        let city = {
          0: [{"city_code": "1", "name": "\u5317\u4eac", "parent_id": "0"}, {
            "city_code": "31",
            "name": "\u65b0\u7586",
            "parent_id": "0"
          }, {"city_code": "4", "name": "\u91cd\u5e86", "parent_id": "0"}, {
            "city_code": "19",
            "name": "\u5e7f\u4e1c",
            "parent_id": "0"
          }, {"city_code": "3", "name": "\u5929\u6d25", "parent_id": "0"}, {
            "city_code": "15",
            "name": "\u6d59\u6c5f",
            "parent_id": "0"
          }, {"city_code": "52993", "name": "\u6e2f\u6fb3", "parent_id": "0"}, {
            "city_code": "20",
            "name": "\u5e7f\u897f",
            "parent_id": "0"
          }, {"city_code": "11", "name": "\u5185\u8499\u53e4", "parent_id": "0"}, {
            "city_code": "30",
            "name": "\u5b81\u590f",
            "parent_id": "0"
          }, {"city_code": "21", "name": "\u6c5f\u897f", "parent_id": "0"}, {
            "city_code": "32",
            "name": "\u53f0\u6e7e",
            "parent_id": "0"
          }, {"city_code": "14", "name": "\u5b89\u5fbd", "parent_id": "0"}, {
            "city_code": "24",
            "name": "\u8d35\u5dde",
            "parent_id": "0"
          }, {"city_code": "27", "name": "\u9655\u897f", "parent_id": "0"}, {
            "city_code": "8",
            "name": "\u8fbd\u5b81",
            "parent_id": "0"
          }, {"city_code": "6", "name": "\u5c71\u897f", "parent_id": "0"}, {
            "city_code": "29",
            "name": "\u9752\u6d77",
            "parent_id": "0"
          }, {"city_code": "22", "name": "\u56db\u5ddd", "parent_id": "0"}, {
            "city_code": "12",
            "name": "\u6c5f\u82cf",
            "parent_id": "0"
          }, {"city_code": "5", "name": "\u6cb3\u5317", "parent_id": "0"}, {
            "city_code": "26",
            "name": "\u897f\u85cf",
            "parent_id": "0"
          }, {"city_code": "84", "name": "\u9493\u9c7c\u5c9b", "parent_id": "0"}, {
            "city_code": "16",
            "name": "\u798f\u5efa",
            "parent_id": "0"
          }, {"city_code": "9", "name": "\u5409\u6797", "parent_id": "0"}, {
            "city_code": "2",
            "name": "\u4e0a\u6d77",
            "parent_id": "0"
          }, {"city_code": "17", "name": "\u6e56\u5317", "parent_id": "0"}, {
            "city_code": "23",
            "name": "\u6d77\u5357",
            "parent_id": "0"
          }, {"city_code": "25", "name": "\u4e91\u5357", "parent_id": "0"}, {
            "city_code": "28",
            "name": "\u7518\u8083",
            "parent_id": "0"
          }, {"city_code": "18", "name": "\u6e56\u5357", "parent_id": "0"}, {
            "city_code": "13",
            "name": "\u5c71\u4e1c",
            "parent_id": "0"
          }, {"city_code": "7", "name": "\u6cb3\u5357", "parent_id": "0"}, {
            "city_code": "10",
            "name": "\u9ed1\u9f99\u6c5f",
            "parent_id": "0"
          }],
          1: [{"city_code": "jfb1", "name": "\u5317\u4eac", "parent_id": "1"}, {
            "city_code": "bj-test1",
            "name": "\u5317\u4eac-\u6d4b\u8bd5",
            "parent_id": "1"
          }],
          jfb1: [{"city_code": "2812", "name": "\u987a\u4e49\u533a", "parent_id": "jfb1"}, {
            "city_code": "2807",
            "name": "\u95e8\u5934\u6c9f",
            "parent_id": "jfb1"
          }, {"city_code": "2803", "name": "\u5d07\u6587\u533a", "parent_id": "jfb1"}, {
            "city_code": "2810",
            "name": "\u5927\u5174\u533a",
            "parent_id": "jfb1"
          }, {"city_code": "2814", "name": "\u6000\u67d4\u533a", "parent_id": "jfb1"}, {
            "city_code": "2801",
            "name": "\u897f\u57ce\u533a",
            "parent_id": "jfb1"
          }, {"city_code": "2804", "name": "\u5ba3\u6b66\u533a", "parent_id": "jfb1"}, {
            "city_code": "2953",
            "name": "\u5e73\u8c37\u533a",
            "parent_id": "jfb1"
          }, {"city_code": "2816", "name": "\u5bc6\u4e91\u533a", "parent_id": "jfb1"}, {
            "city_code": "3065",
            "name": "\u5ef6\u5e86\u533a",
            "parent_id": "jfb1"
          }, {"city_code": "2802", "name": "\u4e1c\u57ce\u533a", "parent_id": "jfb1"}, {
            "city_code": "2901",
            "name": "\u660c\u5e73\u533a",
            "parent_id": "jfb1"
          }, {"city_code": "2805", "name": "\u4e30\u53f0\u533a", "parent_id": "jfb1"}, {
            "city_code": "72",
            "name": "\u671d\u9633\u533a",
            "parent_id": "jfb1"
          }, {"city_code": "2806", "name": "\u77f3\u666f\u5c71\u533a", "parent_id": "jfb1"}, {
            "city_code": "2808",
            "name": "\u623f\u5c71\u533a",
            "parent_id": "jfb1"
          }, {"city_code": "2800", "name": "\u6d77\u6dc0\u533a", "parent_id": "jfb1"}, {
            "city_code": "2809",
            "name": "\u901a\u5dde\u533a",
            "parent_id": "jfb1"
          }],
          2812: [{"city_code": "51130", "name": "\u5149\u660e\u8857\u9053", "parent_id": "2812"}, {
            "city_code": "51125",
            "name": "\u5317\u77f3\u69fd\u9547",
            "parent_id": "2812"
          }, {"city_code": "51147", "name": "\u6768\u9547\u5730\u533a", "parent_id": "2812"}, {
            "city_code": "51126",
            "name": "\u5317\u52a1\u9547",
            "parent_id": "2812"
          }, {"city_code": "51141", "name": "\u4ec1\u548c\u5730\u533a", "parent_id": "2812"}, {
            "city_code": "51139",
            "name": "\u5357\u6cd5\u4fe1\u5730\u533a",
            "parent_id": "2812"
          }, {"city_code": "51134", "name": "\u674e\u9042\u9547", "parent_id": "2812"}, {
            "city_code": "51138",
            "name": "\u5357\u5f69\u9547",
            "parent_id": "2812"
          }, {"city_code": "51127", "name": "\u5317\u5c0f\u8425\u9547", "parent_id": "2812"}, {
            "city_code": "51136",
            "name": "\u9a6c\u5761\u5730\u533a",
            "parent_id": "2812"
          }, {"city_code": "51135", "name": "\u9f99\u6e7e\u5c6f\u9547", "parent_id": "2812"}, {
            "city_code": "51140",
            "name": "\u725b\u680f\u5c71\u5730\u533a",
            "parent_id": "2812"
          }, {"city_code": "51142", "name": "\u80dc\u5229\u8857\u9053", "parent_id": "2812"}, {
            "city_code": "51146",
            "name": "\u65fa\u6cc9\u8857\u9053",
            "parent_id": "2812"
          }, {
            "city_code": "51131",
            "name": "\u540e\u6c99\u5cea\u5730\u533a",
            "parent_id": "2812"
          }, {"city_code": "51133", "name": "\u674e\u6865\u9547", "parent_id": "2812"}, {
            "city_code": "51128",
            "name": "\u5927\u5b59\u5404\u5e84\u9547",
            "parent_id": "2812"
          }, {"city_code": "51149", "name": "\u8d75\u5168\u8425\u9547", "parent_id": "2812"}, {
            "city_code": "51137",
            "name": "\u6728\u6797\u9547",
            "parent_id": "2812"
          }, {"city_code": "51143", "name": "\u77f3\u56ed\u8857\u9053", "parent_id": "2812"}, {
            "city_code": "51132",
            "name": "\u7a7a\u6e2f\u8857\u9053",
            "parent_id": "2812"
          }, {"city_code": "51129", "name": "\u9ad8\u4e3d\u8425\u9547", "parent_id": "2812"}, {
            "city_code": "51144",
            "name": "\u53cc\u4e30\u8857\u9053",
            "parent_id": "2812"
          }, {"city_code": "51145", "name": "\u5929\u7afa\u5730\u533a", "parent_id": "2812"}, {
            "city_code": "51148",
            "name": "\u5f20\u9547",
            "parent_id": "2812"
          }, {"city_code": "qweq123", "name": "\u5e73\u65b9\u8857\u9053", "parent_id": "2812"}]
        };

        let params = {city_code: 0, page_size: 10000};
        if (node.level > 0) {
          params['city_code'] = node['value'];
        }
        if (city[params['city_code']]) {
          let res = city[params['city_code']];
          if (node['level'] === 0) {
            res.splice(0, 0, {
              name: '全国',
              city_code: '0',
              leaf: true
            })
          }
          let temp = this.$xdHelper.idToSelectData(res, 'name', 'city_code', false);
          console.log('getDataRegionList', temp);
          temp.filter(item => {
            if (!item['leaf']) {
              item['leaf'] = false;
              //街道下无子节点
              if (node.level === 3) {
                item['leaf'] = true;
              }
            }
            return item;
          });
          console.log('resolve', temp);
          resolve(temp)
        } else {
          resolve([]);
        }
      },


      handleCilck() {
        this.$refs['testForm'].submitAll()
          .then(valid => {
            console.log('submit', valid, this.$refs['testForm'].getAllFormData())
          })
          .catch((valid) => {
            console.error(valid)
          })

      },

      handleRemoteSearch({query}, resolve) {
        setTimeout(() => {
          let list = this.testResultList.filter(item => {
            return item.label.toLowerCase().indexOf(query.toLowerCase()) > -1;
          });
          resolve(list)
        }, 500);
      },

      handleSearch({form, action}) {
        console.log('handleSearch', form, action)
      },

      handleDone({form, action}) {
        console.log('handleDone', form, action)
      },

      handleSumit(form) {
        console.log('handleSumit', form)
      },

      /**启动上传图片*******=======================================*/
      /**
       * @description 上传到本地服务器成功返回值时刻触发，设置url字段
       */
      handleApiSuccessUrl(result, resolve) {
        resolve(result.data['ObjectURL'])
      },
      /**
       * @description 上传参数设置
       * @param file
       * @param resolve
       */
      handleGetParamsAndHeader(file, resolve) {
        resolve({
          params: {
            token: genUpToken({
              accoutKey: 'bP3Ca5dtSJBNaWwMkihfhuE30CbAZnYrNzQm6eMN',
              serviceKey: 'pPNgWwRL3_Jlj7cPtpYbkhXn01EOZTtUhOs3NqZM',
              webSiteName: 'e56buystatic',
              staticUrl: 'http://static.e56buy.com',
            }),
            key: 'Xd' + this.$xdHelper.randomChar(30)
          }
        });
      },

      handleSuccess(res) {
        console.log(res)
      }
      /**启动上传图片*******=======================================*/
    }
  }

</script>

<style lang="scss" scoped>
  .app-container {
    padding: 20px;

    &__item {
      margin-bottom: 20px;

      &-h1 {
        height: 50px;
        line-height: 50px;
        padding: 0 20px;
        font-weight: bold;
        background: #efefef;
        font-size: 16px;
        text-align: left;
        margin-bottom: 30px;
      }

      &-body {
        padding: 0 20px;

        &-value {
          padding-bottom: 10px;
        }
      }
    }

  }

  @media screen and (max-width: 768px) {
    .app-container {
      padding: 10px 0;

      &__item {
        &-body {
          padding: 0 0px;
        }
      }
    }
  }

  .styleActive ::v-deep .xd-active {
    display: block;
  }

  .styleActive ::v-deep .xd-not-active {
    display: none;
  }
</style>
