1
lzhe
2024-09-26 7d59e8e2c727dd49d9552a8febc2af47c5b95a69
src/components/scForm/index.vue
@@ -4,7 +4,7 @@
 * @Author: sakuya
 * @Date: 2021年9月22日09:26:25
 * @LastEditors: Sneed
 * @LastEditTime: 2024-06-02 15:06:45
 * @LastEditTime: 2024-06-16 15:18:05
-->
<template>
@@ -26,7 +26,8 @@
                  <!-- input -->
                  <template v-if="item.component == 'input'">
                     <el-input v-model="form[item.name]" :placeholder="item.options.placeholder" clearable
                        :maxlength="item.options.maxlength" show-word-limit></el-input>
                        :maxlength="item.options.maxlength" show-word-limit :disabled="item.disabled"
                        :type="item.type"></el-input>
                  </template>
                  <!-- checkbox -->
                  <template v-else-if="item.component == 'checkbox'">
@@ -85,8 +86,8 @@
                  <!-- radio -->
                  <template v-else-if="item.component == 'radio'">
                     <el-radio-group v-model="form[item.name]">
                        <el-radio v-for="_item in item.options.items" :key="_item.value"
                           :label="_item.value">{{ _item.label }}</el-radio>
                        <el-radio v-for="_item in item.options.items" :key="_item.value" :label="_item.value">{{
                           _item.label }}</el-radio>
                     </el-radio-group>
                  </template>
                  <!-- color -->
@@ -109,6 +110,17 @@
                  <template v-else-if="item.component == 'editor'">
                     <sc-editor v-model="form[item.name]" placeholder="请输入" :height="400"></sc-editor>
                  </template>
                  <template v-else-if="item.component == 'el-tree-select'">
                     <el-tree-select v-model="form[item.name]" :data="item.options.data"
                        :check-strictly="item.options.checkStrictly" :multiple="item.options.multiple"
                        :show-checkbox="!item.options.hidecheckbox" default-expand-all style="width: 100%"
                        :props="{
                           label: 'title',
                           id: 'id',
                           ...item.options.props
                        }" node-key="id">
                     </el-tree-select>
                  </template>
                  <!-- noComponent -->
                  <template v-else>
                     <el-tag type="danger">[{{ item.component }}] Component not found</el-tag>