duy преди 2 месеца
родител
ревизия
54e11878a1
променени са 1 файла, в които са добавени 28 реда и са изтрити 1 реда
  1. 28 1
      src/views/tentative/basic/code.vue

+ 28 - 1
src/views/tentative/basic/code.vue

@@ -18,6 +18,7 @@
                     <el-button
                         hc-btn
                         type="primary"
+                        @click="handleAdd()"
                     >
                         <HcIcon name="add-circle" />
                         <span>新增</span>
@@ -25,7 +26,7 @@
                 </HcTooltip>
               
                 <HcTooltip keys="tentative-basic-code-sort">
-                    <el-button hc-btn type="primary" color="#12C060" style="color: white;" @click="editFormModalClick">
+                    <el-button hc-btn type="primary" color="#12C060" style="color: white;">
                         <HcIcon name="arrow-up-down" />
                         <span>排序</span>
                     </el-button>
@@ -53,6 +54,22 @@
                 is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
                 @selection-change="tableSelection"
             >
+                <template #type="{ row }">
+                    <el-select v-model="row.type" placeholder="请选择">
+                        <el-option
+                            v-for="item in menuOptions"
+                            :key="item.key"
+                            :label="item.label"
+                            :value="item.key"
+                        />
+                    </el-select>
+                </template>
+                <template #data="{ row }">
+                    <el-input v-model="row.data" placeholder="请输入数据" />
+                </template>
+                <template #isAutoIncrement="{ row }">
+                    <el-checkbox v-model="row.isAutoIncrement">是否自增</el-checkbox>
+                </template>
                 <template #action="{ row }">
                     <el-button 
                         v-if="!row.isEdit"
@@ -161,6 +178,11 @@ const getTableData = async () => {
     // }
 }
 
+//多选
+const tableCheckedKeys = ref([])
+const tableSelection = (rows) => {
+    tableCheckedKeys.value = rows
+}
 // 编辑行
 const handleEdit = (row) => {
     row.isEdit = true
@@ -175,4 +197,9 @@ const handleSave = async (row) => {
 const handleDelete = async (row) => {
     console.log(row)
 }
+const handleAdd = () => {
+    tableData.value.push({
+        isEdit: true,
+    })
+}
 </script>