+
+
-
-
+
+
@@ -132,7 +152,7 @@ const props = defineProps({
type: Array,
required: false,
default: []
- },
+ }
})
const tableData = props.tableData
const tableFields = props.tableFields
@@ -140,26 +160,28 @@ const TableBaseComponents_Ref = ref()
const TableBaseForm_Ref = ref()
const TableBaseForm_Ref1 = ref()
const tableFormRules = ref(props.tableFormRules)
-console.log('tableFormRules',tableFormRules.value)
+console.log('tableFormRules', tableFormRules.value)
/**
- * 验证表单是否符合rules
- * @param {*} success 如果验证【成功】走的方法
- * @param {*} error 如果验证【不成功】走的方法
- */
+ * 验证表单是否符合rules
+ * @param {*} success 如果验证【成功】走的方法
+ * @param {*} error 如果验证【不成功】走的方法
+ */
- const validateForm = () => {
- let TableBaseForm_Arr = []
- TableBaseForm_Arr.push(TableBaseForm_Ref.value)
- TableBaseForm_Arr.push(TableBaseForm_Ref1.value)
- let _lists = TableBaseForm_Arr?.map(v => v.validate())
- return Promise.all(_lists).then(() => {
- return true
- }).catch(() => {
- return false
- })
+const validateForm = () => {
+ let TableBaseForm_Arr = []
+ TableBaseForm_Arr.push(TableBaseForm_Ref.value)
+ TableBaseForm_Arr.push(TableBaseForm_Ref1.value)
+ let _lists = TableBaseForm_Arr?.map((v) => v.validate())
+ return Promise.all(_lists)
+ .then(() => {
+ return true
+ })
+ .catch(() => {
+ return false
+ })
}
// 传递给父类
-const emit = defineEmits(['handleAddTable', 'selectChange', 'tableFormChange'])
+const emit = defineEmits(['handleAddTable', 'selectChange', 'tableFormChange', 'inpuFocus'])
// 修改盘点类型
const selectChange = (field, val) => {
emit('selectChange', field, val)
@@ -179,21 +201,21 @@ const handleDeleteTable = (row, index) => {
}
const pageCount = ref(1)
-const currentList = (options)=>{
- if(options&&options.length>0){
- return options.slice((pageCount.value-1)*15,pageCount.value*15)
- }else{
+const currentList = (options) => {
+ if (options && options.length > 0) {
+ return options.slice((pageCount.value - 1) * 15, pageCount.value * 15)
+ } else {
return []
}
}
-const nextPage = ()=>{
+const nextPage = () => {
pageCount.value++
}
-const prexPage = ()=>{
+const prexPage = () => {
pageCount.value--
}
const initOptions_result = ref([])
-const filterMethod = (query,row)=>{
+const filterMethod = (query, row) => {
console.log('filterMethod')
if (query) {
initOptions_result.value = row.initOptions.filter((item) => {
@@ -203,25 +225,28 @@ const filterMethod = (query,row)=>{
initOptions_result.value = [...row.initOptions]
}
}
-const focusValue = (row)=>{
- console.log('focusValue',row)
- if(!row.value){
+const focusValue = (row) => {
+ console.log('focusValue', row)
+ if (!row.value) {
initOptions_result.value = [...row.initOptions]
}
}
+const inpuFocus = (headerItem, row) => {
+ console.log(111, headerItem, row)
+ emit('inpuFocus', headerItem, row)
+}
// setup 语法糖 抛出方法
defineExpose({
TableBaseComponents_Ref,
validateForm
})
-