<template>
  <div class="formula_container">
    <div v-if="isAddPreSettingVisible">
      <AddPreSetting :hideSettingModal="hideAddSettingModal" />
    </div>
    <div v-else-if="isUpdatePreSettingVisible">
      <UpdatePreSetting
        :formulaInfo="formulaInfo"
        :hideSettingModal="hideUpdateSettingModal"
      />
    </div>
    <div v-else>
      <div class="header_wrap">
        <p>配方名称</p>
        <p>操作</p>
      </div>
      <div
        :class="
          formulaStore?.formulaList?.length == 0
            ? 'content_wrap layout'
            : 'content_wrap'
        "
      >
        <div
          class="line"
          v-for="item in formulaStore?.formulaList"
          :key="item.id"
        >
          <div class="username">{{ item?.formula_id }}</div>
          <div class="btns">
            <div class="btn" @click="delModalShow(item)">删除</div>
            <div class="btn mg" @click="showUpdateSetting(item)">配置</div>
            <div class="btn" @click="runConfig(item)">执行</div>
          </div>
        </div>
        <svg
          v-if="formulaStore?.formulaList?.length == 0"
          xmlns="http://www.w3.org/2000/svg"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          fill="none"
          version="1.1"
          width="129"
          height="148.6171875"
          viewBox="0 0 129 148.6171875"
        >
          <g>
            <g>
              <path
                d="M77.56318437499999,42.283203125L77.56318437499999,47.883203125C77.56318437499999,49.516503125,78.93818437499999,50.683203125,80.771484375,50.683203125L87.41728437500001,50.683203125L87.41728437500001,64.91650312499999C87.41728437500001,66.549903125,86.04228437500001,67.716503125,84.208984375,67.716503125L67.708984375,67.716503125C65.87568437499999,67.716503125,64.50068437499999,66.316503125,64.50068437499999,64.91650312499999L64.50068437499999,44.849903125C64.50068437499999,43.216503125,65.87568437499999,42.049903125,67.708984375,42.049903125L77.56318437499999,42.049903125L77.56318437499999,42.283203125ZM42.500651375,52.083203125C45.021484375,54.883203125,50.063154374999996,56.983203125,59.000684375,56.983203125L60.604784375,56.983203125L60.604784375,66.783203125L59.000684375,66.783203125C48.000654374999996,66.783203125,41.583984784782,63.516503125,41.583984784782,59.783203125L41.583984784782,54.183203125C41.583984784782,53.483203125,41.813151375,52.783203125,42.500651375,52.083203125ZM78.25068437499999,63.283203125L69.083984375,63.283203125L69.083984375,65.61650312500001L78.25068437499999,65.61650312500001L78.25068437499999,63.283203125ZM82.833984375,58.616503125L69.083984375,58.616503125L69.083984375,60.949903125L82.833984375,60.949903125L82.833984375,58.616503125ZM82.833984375,53.949903125L69.083984375,53.949903125L69.083984375,56.283203125L82.833984375,56.283203125L82.833984375,53.949903125ZM42.500651375,38.316503125C45.021484375,41.116503125,50.063154374999996,43.216503125,59.000684375,43.216503125L60.604784375,43.216503125L60.604784375,53.016503125L59.000684375,53.016503125C48.000654374999996,53.016503125,41.583984784782,49.749903125,41.583984784782,46.016503125L41.583984784782,40.416503125C41.583984784782,39.716503125,41.813151375,39.016503125,42.500651375,38.316503125ZM80.54228437500001,42.283203125L87.41728437500001,49.283203125L81.91728437500001,49.283203125C81.22978437500001,49.283203125,80.54228437500001,48.583203125,80.54228437500001,47.883203125L80.54228437500001,42.283203125ZM59.000684375,21.283203125C70.00068437499999,21.283203125,77.56318437499999,24.316533125,77.56318437499999,28.283203125L77.56318437499999,32.483203125C77.56318437499999,36.449903125,70.00068437499999,39.483203125,59.000684375,39.483203125C48.000654374999996,39.483203125,41.583984375,36.449903125,41.583984375,32.483203125L41.583984375,28.283203125C41.583984375,24.316533125,48.000654374999996,21.283202707767,59.000684375,21.283203125Z"
                fill="#999999"
                fill-opacity="1"
              />
            </g>
            <g>
              <path
                d="M63.989446875,0C39.391046875,0,19.373046875,20.2104,19.373046875,45.0454C19.373046875,69.8804,39.391046875,90.0908,63.989446875,90.0908C88.587846875,90.0908,108.605846875,69.8804,108.605846875,45.0454C108.605846875,20.2104,88.598046875,0,63.989446875,0ZM63.989446875,83.7231C42.864446875,83.7231,25.680076875,66.3735,25.680076875,45.0454C25.680076875,36.145,28.686326875,27.9419,33.703546875,21.3999L89.999646875,73.3975C83.17464687500001,79.7959,74.033946875,83.7231,63.989446875,83.7231ZM94.275346875,68.6909L37.969146875,16.6934C44.804246875000004,10.2949,53.955046875,6.36768,63.989446875,6.36768C85.114446875,6.36768,102.298846875,23.7173,102.298846875,45.0454C102.298846875,53.9458,99.302746875,62.1489,94.275346875,68.6909Z"
                fill="#999999"
                fill-opacity="1"
              />
            </g>
            <g>
              <path
                d="M16.89,116.8571875L16.89,121.2971875C16.89,123.7571875,16.68,126.9971875,14.73,129.3971875C15.33,129.6671875,16.44,130.4171875,16.89,130.8371875C18.45,128.9171875,19.08,126.2471875,19.32,123.8171875L22.71,123.8171875L22.71,130.6871875L25.32,130.6871875L25.32,123.8171875L28.62,123.8171875L28.62,121.5371875L19.41,121.5371875L19.41,121.3571875L19.41,118.7771875C22.41,118.5371875,25.62,118.0571875,27.96,117.3671875L26.58,115.2296875C24.21,116.0134875,20.25,116.5866875,16.89,116.8571875ZM7.77,137.4671875L22.23,137.4671875L22.23,139.53718750000002L7.77,139.53718750000002L7.77,137.4671875ZM7.77,135.5171875L7.77,133.4771875L22.23,133.4771875L22.23,135.5171875L7.77,135.5171875ZM5.07,131.3171875L5.07,142.72468750000002L7.77,142.72468750000002L7.77,141.7271875L22.23,141.7271875L22.23,142.6941875L25.05,142.6941875L25.05,131.3171875L5.07,131.3171875ZM1.56,126.6971875L1.77,129.03718750000002L8.55,128.3171875L8.55,130.6871875L11.16,130.6871875L11.16,128.0471875L15.39,127.5671875L15.36,125.5271875L11.16,125.8871875L11.16,124.0271875L15.66,124.0271875L15.66,121.8071875L11.16,121.8071875L11.16,119.9471875L8.55,119.9471875L8.55,121.8071875L5.16,121.8071875C5.91,120.9371875,6.69,119.9771875,7.44,118.9271875L15.57,118.9271875L15.57,116.7671875L8.88,116.7671875L9.6,115.5615675L6.75,114.8378175C6.48,115.4710975,6.15,116.1343875,5.82,116.7671875L1.53,116.7671875L1.53,118.9271875L4.53,118.9271875C3.99,119.7371875,3.54,120.3671875,3.3,120.6671875C2.7,121.3571875,2.22,121.8371875,1.71,121.9571875C2.01,122.6471875,2.43,123.9371875,2.58,124.4771875C2.85,124.2071875,3.87,124.0271875,5.1,124.0271875L8.55,124.0271875L8.55,126.1271875L1.56,126.6971875ZM36.33,116.82718750000001L36.33,119.6171875L46.02,119.6171875C45.96,121.5671875,45.87,123.57718750000001,45.6,125.5571875L34.47,125.5571875L34.47,128.3471875L45.06,128.3471875C43.83,133.2671875,40.95,137.7671875,34.05,140.3471875C34.77,140.94718749999998,35.58,141.9671875,35.97,142.7232875C43.68,139.5971875,46.71,134.1671875,48,128.3471875L48.24,128.3471875L48.24,137.94718749999998C48.24,141.0671875,49.14,141.9971875,52.56,141.9971875C53.25,141.9971875,56.94,141.9971875,57.66,141.9971875C60.72,141.9971875,61.59,140.7071875,61.92,135.7571875C61.11,135.5471875,59.82,135.0671875,59.19,134.5571875C59.04,138.5471875,58.83,139.2071875,57.45,139.2071875C56.61,139.2071875,53.55,139.2071875,52.89,139.2071875C51.45,139.2071875,51.21,139.0271875,51.21,137.9171875L51.21,128.3471875L61.65,128.3471875L61.65,125.5571875L48.48,125.5571875C48.75,123.57718750000001,48.84,121.5671875,48.93,119.6171875L59.97,119.6171875L59.97,116.82718750000001L36.33,116.82718750000001ZM79.05,115.3459375C78.54,116.4887875,77.61,118.2024875,76.89,119.2848875L78.72,120.1266875C79.53,119.1648875,80.49,117.6915875,81.42,116.3382875L79.05,115.3459375ZM68.37,116.3382875C69.15,117.5710875,69.9,119.2248875,70.14,120.2771875L72.3,119.3152875C72.03,118.2624875,71.22,116.66918749999999,70.41,115.4964075L68.37,116.3382875ZM77.82,132.69718749999998C77.19,134.0190875,76.35,135.1909875,75.36,136.1818875C74.37,135.6713875,73.35,135.1909875,72.36,134.7399875L73.5,132.69718749999998L77.82,132.69718749999998ZM68.91,135.6713875C70.32,136.2423875,71.91,136.9932875,73.38,137.77418749999998C71.55,139.0060875,69.39,139.87698749999998,67.05,140.3879875C67.53,140.92848750000002,68.07,141.91988750000002,68.34,142.5507875C71.07,141.7998875,73.59,140.6879875,75.69,139.0360875C76.65,139.6065875,77.49,140.1474875,78.15,140.6579875L79.86,138.7955875C79.2,138.3451875,78.39,137.8641875,77.52,137.3537875C79.08,135.6113875,80.28,133.4785875,81.03,130.8371875L79.5,130.2671875L79.05,130.3571875L74.64,130.3571875L75.21,128.9771875L72.72,128.4971875C72.48,129.0971875,72.24,129.7271875,71.94,130.3571875L67.98,130.3571875L67.98,132.69718749999998L70.74,132.69718749999998C70.14,133.8090875,69.48,134.8304875,68.91,135.6713875ZM73.38,114.8349975L73.38,120.3371875L67.41,120.3371875L67.41,122.6171875L72.51,122.6171875C71.04,124.3571875,68.91,125.9771875,66.96,126.7871875C67.5,127.32718750000001,68.13,128.28718750000002,68.46,128.9171875C70.14,127.9871875,71.94,126.5471875,73.38,124.9571875L73.38,128.1371875L76.02,128.1371875L76.02,124.3871875C77.34,125.3771875,78.87,126.6071875,79.59,127.2971875L81.12,125.2871875C80.49,124.8671875,78.3,123.4871875,76.8,122.6171875L81.96,122.6171875L81.96,120.3371875L76.02,120.3371875L76.02,114.8349975L73.38,114.8349975ZM84.63,115.0454675C83.94,120.3671875,82.59,125.4371875,80.22,128.5871875C80.82,128.9771875,81.9,129.9071875,82.32,130.3571875C82.98,129.3671875,83.61,128.2571875,84.15,127.0271875C84.78,129.6671875,85.56,132.0971875,86.58,134.2894875C84.93,136.9932875,82.65,139.0660875,79.5,140.53798749999999C80.01,141.0788875,80.76,142.2502875,81.03,142.8512875C84,141.2888875,86.25,139.3365875,87.96,136.87278750000002C89.4,139.21608750000001,91.2,141.1088875,93.42,142.4607875C93.84,141.7698875,94.65,140.7484875,95.28,140.2374875C92.88,138.9455875,90.99,136.87278750000002,89.49,134.2894875C91.02,131.2571875,91.98,127.5971875,92.61,123.1871875L94.59,123.1871875L94.59,120.57718750000001L86.25,120.57718750000001C86.64,118.9238875,86.97,117.1796875,87.24,115.4059375L84.63,115.0454675ZM89.97,123.1871875C89.55,126.2771875,88.95,128.94718749999998,88.05,131.28718750000002C87.06,128.8271875,86.31,126.0971875,85.8,123.1871875L89.97,123.1871875ZM113.52,133.1171875L113.52,142.72468750000002L116.01,142.72468750000002L116.01,141.6671875L124.38,141.6671875L124.38,142.6641875L126.96,142.6641875L126.96,133.1171875L121.35,133.1171875L121.35,129.7571875L127.77,129.7571875L127.77,127.3571875L121.35,127.3571875L121.35,124.32718750000001L126.84,124.32718750000001L126.84,116.1371875L110.67,116.1371875L110.67,125.2571875C110.67,129.9971875,110.43,136.5671875,107.34,141.1271875C108,141.3971875,109.17,142.2713875,109.68,142.7551875C112.08,139.2071875,112.98,134.19718749999998,113.28,129.7571875L118.65,129.7571875L118.65,133.1171875L113.52,133.1171875ZM113.43,118.5971875L124.14,118.5971875L124.14,121.8671875L113.43,121.8671875L113.43,118.5971875ZM113.43,124.32718750000001L118.65,124.32718750000001L118.65,127.3571875L113.4,127.3571875L113.43,125.2571875L113.43,124.32718750000001ZM116.01,139.3571875L116.01,135.4871875L124.38,135.4871875L124.38,139.3571875L116.01,139.3571875ZM103.68,114.8996875L103.68,120.7571875L100.2,120.7571875L100.2,123.3971875L103.68,123.3971875L103.68,129.4571875L99.78,130.5071875L100.44,133.2371875L103.68,132.2471875L103.68,139.2971875C103.68,139.7171875,103.53,139.8371875,103.17,139.8371875C102.81,139.8371875,101.7,139.8371875,100.5,139.8071875C100.86,140.5571875,101.19,141.7571875,101.25,142.4171875C103.17,142.4476875,104.4,142.3571875,105.21,141.9071875C106.02,141.4571875,106.29,140.7371875,106.29,139.2971875L106.29,131.4371875L109.59,130.4171875L109.23,127.8371875L106.29,128.7071875L106.29,123.3971875L109.53,123.3971875L109.53,120.7571875L106.29,120.7571875L106.29,114.8996875L103.68,114.8996875Z"
                fill="#9E9E9E"
                fill-opacity="1"
              />
            </g>
          </g>
        </svg>
      </div>
      <div class="bottom_btn">
        <svg
          @click="addNewPre"
          xmlns="http://www.w3.org/2000/svg"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          fill="none"
          version="1.1"
          width="158"
          height="40"
          viewBox="0 0 158 40"
        >
          <g>
            <g>
              <g>
                <rect
                  x="0"
                  y="0"
                  width="158"
                  height="40"
                  rx="20"
                  fill="#06518B"
                  fill-opacity="1"
                />
              </g>
              <g>
                <path
                  d="M21.014699999999998,7Q23.694200000000002,7,26.0646,8.017009999999999Q28.4349,9.03401,30.2016,10.80272Q31.9683,12.57143,32.9841,14.94445Q34,17.317500000000003,34,20Q34,22.712,32.9841,25.0703Q31.9683,27.4286,30.2016,29.1973Q28.4349,30.966,26.0646,31.983Q23.694200000000002,33,21.014699999999998,33Q18.305799999999998,33,15.93545,31.983Q13.56512,30.966,11.79841,29.1973Q10.03171,27.4286,9.01585,25.0703Q7.999999670926,22.712,8,20Q8,17.317500000000003,9.01585,14.94445Q10.03171,12.57143,11.79841,10.80272Q13.56512,9.03401,15.93545,8.017009999999999Q18.305799999999998,6.999999231289,21.014699999999998,7ZM28.4349,21.7982Q29.2005,21.7982,29.7305,21.2528Q30.2605,20.7075,30.2605,19.941000000000003Q30.2605,19.174599999999998,29.7305,18.644Q29.2005,18.1134,28.4349,18.1134L22.8992,18.1134L22.8992,12.57143Q22.8992,11.80499,22.3545,11.259640000000001Q21.8097,10.71429,21.0442,10.71429Q20.2786,10.71429,19.7486,11.259640000000001Q19.218600000000002,11.80499,19.218600000000002,12.57143L19.218600000000002,18.1134L13.6829,18.1134Q12.91733,18.1134,12.387319999999999,18.644Q11.85731,19.174599999999998,11.85731,19.941000000000003Q11.85731,20.7075,12.387319999999999,21.2528Q12.91733,21.7982,13.6829,21.7982L19.218600000000002,21.7982L19.218600000000002,27.3107Q19.218600000000002,28.0771,19.7486,28.6225Q20.2786,29.1678,21.0442,29.1678Q21.8097,29.1678,22.3545,28.6225Q22.8992,28.0771,22.8992,27.3107L22.8992,21.7982L28.4349,21.7982Z"
                  fill="#FFFFFF"
                  fill-opacity="1"
                />
              </g>
              <g>
                <path
                  d="M53.512,22.852C53.144,24.067999999999998,52.472,25.46,51.480000000000004,26.276L52.36,26.932C53.4,26.004,54.056,24.5,54.456,23.22L53.512,22.852ZM57.288,23.412C57.752,24.484,58.216,25.892,58.344,26.836L59.32,26.468C59.16,25.556,58.712,24.164,58.184,23.108L57.288,23.412ZM59.256,22.98C60.168,24.195999999999998,61.128,25.876,61.512,26.98L62.519999999999996,26.468C62.104,25.364,61.144,23.747999999999998,60.2,22.532L59.256,22.98ZM55.528,21.124000000000002L55.528,27.428C55.528,27.62,55.464,27.684,55.24,27.684C55.032,27.684,54.344,27.7,53.544,27.668C53.688,28.004,53.832,28.436,53.88,28.756C54.952,28.756,55.656,28.74,56.088,28.564C56.519999999999996,28.388,56.647999999999996,28.068,56.647999999999996,27.444L56.647999999999996,21.124000000000002L55.528,21.124000000000002ZM48.36,15.044C49.288,15.508,50.408,16.26025,50.936,16.80475L51.656,15.828C51.096000000000004,15.3,49.976,14.6105,49.064,14.17625L48.36,15.044ZM47.608,19.3823C48.568,19.7985,49.72,20.486800000000002,50.28,20.999299999999998L50.968,20.0225C50.392,19.5103,49.24,18.88575,48.264,18.50175L47.608,19.3823ZM47.96,27.8833L49.032,28.5555C49.736,27.1308,50.536,25.2578,51.144,23.6568L50.184,22.984299999999998C49.512,24.7133,48.6,26.6985,47.96,27.8833ZM52.232,14.948L52.232,16.067999999999998L55.768,16.067999999999998C55.592,16.804000000000002,55.352000000000004,17.524,55.048,18.212L51.496,18.212L51.496,19.348L54.456,19.348C53.656,20.6453,52.552,21.766,51.064,22.5028C51.288,22.7268,51.64,23.1593,51.8,23.4155C53.624,22.4708,54.903999999999996,21.0295,55.8,19.348L57.816,19.348C58.712,20.9495,60.216,22.4225,61.752,23.1593C61.928,22.871000000000002,62.296,22.4545,62.536,22.2305C61.208,21.67,59.912,20.5813,59.064,19.348L62.263999999999996,19.348L62.263999999999996,18.212L56.344,18.212C56.616,17.524,56.84,16.804000000000002,57.032,16.067999999999998L61.72,16.067999999999998L61.72,14.948L52.232,14.948ZM73.752,16.02L73.752,28.5208L74.904,28.5208L74.904,27.332L78.008,27.332L78.008,28.3923L79.208,28.3923L79.208,16.02L73.752,16.02ZM74.904,26.18L74.904,17.188000000000002L78.008,17.188000000000002L78.008,26.18L74.904,26.18ZM67.72,14.238L67.70400000000001,17.076L65.44800000000001,17.076L65.44800000000001,18.244L67.672,18.244C67.56,22.276,67.064,25.828,65.048,27.94C65.352,28.132,65.78399999999999,28.5,65.976,28.7745C68.136,26.42,68.696,22.58,68.84,18.244L71.27199999999999,18.244C71.144,24.404,71,26.596,70.664,27.06C70.52,27.268,70.36,27.332,70.12,27.316C69.832,27.316,69.144,27.316,68.392,27.252C68.6,27.588,68.712,28.1,68.744,28.452C69.464,28.5,70.2,28.5163,70.648,28.452C71.112,28.388,71.416,28.244,71.70400000000001,27.828C72.2,27.14,72.312,24.804000000000002,72.44,17.683999999999997C72.44,17.508,72.44,17.076,72.44,17.076L68.872,17.076L68.904,14.238L67.72,14.238ZM87.96000000000001,24.067999999999998C88.44,24.868000000000002,89.01599999999999,25.956,89.27199999999999,26.66L90.12,26.148C89.88,25.476,89.304,24.436,88.77600000000001,23.636L87.96000000000001,24.067999999999998ZM84.36,23.716C84.03999999999999,24.692,83.512,25.684,82.856,26.388C83.096,26.532,83.512,26.836,83.70400000000001,26.996C84.328,26.244,84.968,25.076,85.336,23.956L84.36,23.716ZM91.048,15.57175L91.048,21.076C91.048,23.204,90.92,25.956,89.56,27.876C89.816,28.02,90.29599999999999,28.388,90.488,28.6138C91.96000000000001,26.5375,92.168,23.3828,92.168,21.0768L92.168,20.564L94.6,20.564L94.6,28.6835L95.768,28.6835L95.768,20.564L97.52799999999999,20.564L97.52799999999999,19.444000000000003L92.168,19.444000000000003L92.168,16.368000000000002C93.864,16.11175,95.688,15.69525,97.032,15.1985L96.056,14.31725C94.904,14.801,92.84,15.28275,91.048,15.57175ZM85.624,14.239C85.88,14.688500000000001,86.136,15.2345,86.328,15.716000000000001L83.176,15.716000000000001L83.176,16.724L90.24799999999999,16.724L90.24799999999999,15.716000000000001L87.576,15.716000000000001C87.368,15.186250000000001,87.01599999999999,14.496,86.712,13.966000000000001L85.624,14.239ZM88.232,16.804000000000002C88.03999999999999,17.54,87.672,18.628,87.368,19.364L82.936,19.364L82.936,20.387999999999998L86.21600000000001,20.387999999999998L86.21600000000001,22.052L83,22.052L83,23.108L86.21600000000001,23.108L86.21600000000001,27.188C86.21600000000001,27.348,86.184,27.396,86.024,27.396C85.848,27.412,85.352,27.412,84.792,27.396C84.952,27.684,85.112,28.132,85.144,28.42C85.928,28.42,86.47200000000001,28.404,86.84,28.228C87.208,28.052,87.32,27.764,87.32,27.204L87.32,23.108L90.312,23.108L90.312,22.052L87.32,22.052L87.32,20.387999999999998L90.50399999999999,20.387999999999998L90.50399999999999,19.364L88.456,19.364C88.75999999999999,18.69125,89.064,17.826,89.352,17.041L88.232,16.804000000000002ZM84.21600000000001,17.060499999999998C84.536,17.780749999999998,84.77600000000001,18.741500000000002,84.84,19.3658L85.88,19.0778C85.8,18.469250000000002,85.52799999999999,17.524749999999997,85.19200000000001,16.83625L84.21600000000001,17.060499999999998ZM110.52000000000001,19.555999999999997L110.52000000000001,22.756C110.52000000000001,24.404,110.152,26.564,106.36,27.812C106.632,28.036,106.952,28.436,107.096,28.676C111.16,27.188,111.656,24.788,111.656,22.772L111.656,19.555999999999997L110.52000000000001,19.555999999999997ZM111.4,26.068C112.408,26.868,113.704,28.02,114.328,28.7403L115.16,27.892C114.52,27.204,113.192,26.1,112.2,25.332L111.4,26.068ZM101.208,17.747999999999998C102.184,18.404,103.432,19.284,104.312,19.956L100.408,19.956L100.408,21.028L103.048,21.028L103.048,27.316C103.048,27.524,102.98400000000001,27.572,102.744,27.588C102.52000000000001,27.588,101.78399999999999,27.588,100.952,27.572C101.128,27.908,101.288,28.388,101.336,28.724C102.44,28.724,103.16,28.708,103.608,28.516C104.072,28.324,104.2,27.988,104.2,27.348L104.2,21.028L105.912,21.028C105.624,21.892,105.304,22.772,105.01599999999999,23.380000000000003L105.928,23.619999999999997C106.36,22.756,106.856,21.348,107.27199999999999,20.116L106.52000000000001,19.908L106.344,19.956L105.256,19.956L105.576,19.54C105.208,19.252000000000002,104.696,18.868000000000002,104.12,18.484C105.064,17.636,106.104,16.404,106.792,15.251999999999999L106.056,14.73975L105.848,14.804L100.744,14.804L100.744,15.876000000000001L105.048,15.876000000000001C104.55199999999999,16.596,103.896,17.380000000000003,103.288,17.908L101.864,16.98L101.208,17.747999999999998ZM107.8,17.428L107.8,25.044L108.92,25.044L108.92,18.532L113.336,18.532L113.336,25.012L114.504,25.012L114.504,17.428L111.384,17.428L111.944,15.828L115.144,15.828L115.144,14.74L107.22399999999999,14.74L107.22399999999999,15.828L110.632,15.828C110.52000000000001,16.356,110.376,16.932000000000002,110.232,17.428L107.8,17.428ZM119.352,15.059999999999999C120.2,15.812000000000001,121.272,16.884,121.768,17.572L122.584,16.724C122.072,16.067999999999998,121,15.027999999999999,120.136,14.32225L119.352,15.059999999999999ZM118.088,19.060000000000002L118.088,20.212L120.344,20.212L120.344,25.9603C120.344,26.697,119.848,27.2258,119.544,27.418C119.768,27.6583,120.088,28.1548,120.2,28.443C120.44,28.1228,120.872,27.8023,123.72,25.688C123.576,25.4478,123.384,24.999299999999998,123.288,24.678800000000003L121.512,25.9763L121.512,19.060000000000002L118.088,19.060000000000002ZM125.256,14.612L125.256,16.387999999999998C125.256,17.572,124.904,18.9,122.792,19.86C123.016,20.052,123.432,20.516,123.576,20.756C125.88,19.652,126.392,17.924,126.392,16.42L126.392,15.732L129.224,15.732L129.224,18.308C129.224,19.524,129.44799999999998,19.972,130.56799999999998,19.972C130.744,19.972,131.52800000000002,19.972,131.768,19.972C132.088,19.972,132.424,19.956,132.61599999999999,19.892C132.56799999999998,19.619999999999997,132.536,19.156,132.50400000000002,18.852C132.312,18.9,131.976,18.932000000000002,131.752,18.932000000000002C131.54399999999998,18.932000000000002,130.824,18.932000000000002,130.648,18.932000000000002C130.392,18.932000000000002,130.36,18.788,130.36,18.323999999999998L130.36,14.612L125.256,14.612ZM130.28,22.228C129.704,23.5095,128.84,24.5668,127.784,25.4158C126.712,24.5348,125.864,23.4615,125.288,22.228L130.28,22.228ZM123.544,21.108L123.544,22.228L124.376,22.228L124.152,22.3083C124.792,23.7818,125.704,25.0633,126.84,26.1045C125.64,26.8733,124.264,27.402,122.856,27.7223C123.08,27.9785,123.336,28.459,123.432,28.7635C124.984,28.347,126.456,27.7383,127.752,26.8573C128.96800000000002,27.7543,130.424,28.411,132.072,28.8115C132.216,28.475,132.55200000000002,27.9945,132.808,27.7383C131.272,27.418,129.89600000000002,26.8573,128.728,26.1045C130.088,24.9193,131.176,23.381500000000003,131.816,21.380000000000003L131.07999999999998,21.060000000000002L130.872,21.108L123.544,21.108Z"
                  fill="#FFFFFF"
                  fill-opacity="1"
                />
              </g>
            </g>
          </g>
        </svg>
      </div>
    </div>
    <DelPreModal v-if="delPreModalVisible" :hideDelModal="hideDelModal" />
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue'
import DelPreModal from 'cpns/dialogs/DelPreModal'
import AddPreSetting from './AddPreSetting'
import UpdatePreSetting from './UpdatePreSetting'
import { getAllFormulaJSON } from '@/mock/command'
import { useWebSocketStore, useFormulaStore } from '@/store'
import { startFormulaJSON } from '@/mock/command'

const webSocketStore = useWebSocketStore()
const formulaStore = useFormulaStore()

const delPreModalVisible = ref(false)

const delModalShow = item => {
  formulaStore.updateCurrentFormula(item)
  delPreModalVisible.value = true
}

const hideDelModal = () => {
  delPreModalVisible.value = false
}

const isAddPreSettingVisible = ref(false)
const isUpdatePreSettingVisible = ref(false)
const formulaInfo = ref({})
const showUpdateSetting = item => {
  formulaInfo.value = item
  console.log(item)
  formulaStore.updateCurrentFormula(item)
  isUpdatePreSettingVisible.value = true
}

const hideUpdateSettingModal = () => {
  formulaInfo.value = {}
  isUpdatePreSettingVisible.value = false
}

const hideAddSettingModal = () => {
  isAddPreSettingVisible.value = false
}

// 执行配置
const runConfig = item => {
  formulaStore.updateCurrentFormula(item)
  webSocketStore.sendCommandMsg(startFormulaJSON(item.id))
  console.log('run config', item)
}

const addNewPre = () => {
  // 添加新预设
  isAddPreSettingVisible.value = true
}

onMounted(() => {
  webSocketStore.sendCommandMsg(getAllFormulaJSON)
})
</script>

<style lang="scss" scoped>
.formula_container {
  margin-bottom: 19px;
  height: 580px;
  box-sizing: border-box;
  border-radius: 16px;
  background: #fff;
  .header_wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80.29px;
    background: #f6f6f6;
    border-radius: 16px 16px 0px 0px;
    padding: 0 130px;
    box-sizing: border-box;
    font-family: Source Han Sans CN;
    font-size: 18px;
    font-weight: normal;
    line-height: normal;
    letter-spacing: 0.07em;
    color: #999999;
    padding-right: 192px;
  }
  .content_wrap {
    height: 446px;
    overflow: scroll;
    box-sizing: border-box;
    .line {
      padding: 12px;
      padding-left: 40px;
      padding-right: 60px;
      font-family: Source Han Sans CN;
      font-size: 18px;
      font-weight: normal;
      line-height: normal;
      letter-spacing: 0.07em;
      color: #191919;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid #f6f6f6;
      box-sizing: border-box;
      .username {
        width: 251px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        text-align: center;
      }
      .btns {
        display: flex;
        align-items: center;
        .btn {
          width: 87px;
          height: 45px;
          border-radius: 23px;
          background: #06518b;
          display: flex;
          align-items: center;
          justify-content: center;
          font-family: Source Han Sans CN;
          font-size: 20px;
          font-weight: normal;
          line-height: normal;
          letter-spacing: 0.1em;
          color: #ffffff;
        }
        .mg {
          margin: 0 20px;
        }
      }
    }
  }
  .layout {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .bottom_btn {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 20px;
  }
}
</style>
