<template>
  <div>
    <h3 class="component1">量表标准分-原始分转换工具</h3>
    <el-input v-model="str" type="textarea" :autosize="{ minRows: 6, maxRows: 12 }"/>
    <el-button @click="conversion(str)"> 转换</el-button>


    <el-popover
        ref="pop"
        placement="right"
        width="400"
        trigger="click">
      <el-button>换换法第三方士大夫</el-button>
    </el-popover>


    <el-button v-popover:pop >click 激活</el-button>



    <el-input v-model="conversion_str" type="textarea" :autosize="{ minRows: 6, maxRows: 12 }"/>


  </div>
</template>

<script>
export default {
  name: 'component1',
  data () {
    return {
      str: '',
      conversion_str: ''
    }
  },
  methods: {
    conversion (tableStr) {
      this.conversion_str =
          tableStr
              .replace(/(，|	| |, )/gm, ' ')
              .replace(/(?<=\s)(\d+|#)( ?)/gm, '"$1",')
              .replace(/((,"#")+)?,[\s]*$/gm, '')
              .replace(/(("(\d+|\#)",)+("(\d+|\#)"$))/gm, `Arrays.asList([$1]);`)
    }
  },
  created () {
  }
}
</script>
<style src="../../../static/base.css"></style>

INSERT INTO gauge_library_scale_answer_conclusion.`_tb_user_answer_factor` (`_rid`, `_shortId`, `_gauge_id`, `_factor_id`, `_factor_name`, `_original_score`, `_standard_score`, `_average_score`, `_conclusion`, `_dimension1`, `_dimension2`, `_dimension3`, `_dimension4`, `_dimension5`, `_pd_answer_dept_user_id`, `_answer_user_id`, `_create_time`) values
('21', 'fdasfasdrwe', 12, 1, '测试因子A', '1', '2', '3', '正常', '10', '03', '11', '01', NULL, 5, 5, NULL),
('22', 'fdasfasdrwe', 12, 2, '测试因子B', '1', '2', '3', '正常', '10', '03', '11', '01', NULL, 5, 5, NULL),
('23', 'fdasfasdrwe', 12, 3, '测试因子c', '1', '2', '3', '正常', '10', '03', '11', '01', NULL, 5, 5, NULL),
('24', 'fdasfasdrwe', 12, 4, '测试因子D', '1', '2', '3', '正常', '10', '03', '11', '01', NULL, 5, 5, NULL),
('25', 'fdasfasdrwe', 12, 5, '测试因子E', '1', '2', '3', '正常', '10', '03', '11', '01', NULL, 5, 5, NULL),

('26', 'fdasfasdrwe', 12, 1, '测试因子A', '1', '2', '3', '正常', '10', '03', '11', '01', NULL, 6, 6, NULL),
('27', 'fdasfasdrwe', 12, 2, '测试因子B', '1', '2', '3', '正常', '10', '03', '11', '01', NULL, 6, 6, NULL),
('28', 'fdasfasdrwe', 12, 3, '测试因子c', '1', '2', '3', '正常', '10', '03', '11', '01', NULL, 6, 6, NULL),
('29', 'fdasfasdrwe', 12, 4, '测试因子D', '1', '2', '3', '正常', '10', '03', '11', '01', NULL, 6, 6, NULL),
('30', 'fdasfasdrwe', 12, 5, '测试因子E', '1', '2', '3', '正常', '10', '03', '11', '01', NULL, 6, 6, NULL);

