放弃 选错了能力 仔细查看说明!!!

This commit is contained in:
2025-03-16 20:19:55 +08:00
parent 1ef00fa52a
commit f6d8573cbc
3 changed files with 118 additions and 48 deletions

View File

@ -1,36 +1,79 @@
<script>
import { bitable } from '@lark-opdev/block-bitable-api';
import {
bitable
} from "@lark-opdev/block-bitable-api";
import { ref, onMounted } from 'vue';
import {
ElButton,
ElForm,
ElFormItem,
ElSelect,
ElOption,
ElInputNumber,
ElText,
} from 'element-plus';
import { Minus, Plus } from '@element-plus/icons-vue';
export default {
components: {
ElButton,
ElForm,
ElFormItem,
ElSelect,
ElOption,
ElInputNumber,
ElText,
},
setup() {
const amount = ref(1)
const handleChange = (value) => {
console.log(value)
}
const waimoId = {
tableId: 'tbluSufkcQm0noBz',
viewId: 'vewLYvBFns',
tagId: 'fld2xdCqrs',
amountId: 'fldC9cnnAY',
checkedId: 'fldJkHhQgQ',
sortId: 'fldgsRl1q5',
}
const youxinId = {
tableId: 'tbl9NPZQMl5IVHQ2',
viewId: 'vewrOuK32q',
tagId: 'fldrxqL8uz',
amountId: 'fldsOIpOBk',
checkedId: 'fldsuS6SuR',
sortId: '----',
}
const amount = ref(1);
const sort = ref(1);
const message = ref('Hello World');
const tag = ref('Hello World');
const handleChange = (value) => {
console.log(value)
}
const formData = ref({ table: '' });
const tableMetaList = ref([]);
const getRecordId = async (id) => {
const table = await bitable.base.getTableById(id.tableId); // 获取当前数据表实例
const view = await table.getViewById(id.viewId); // 根据id随机获取一个视图实例
const res = await view.getVisibleRecordIdList(sortInfo = {"fieldId": "排序","desc": false,},)
console.log(res)
}
const getCurrent = async (id) => {
const { tableId, recordId } = await bitable.base.getSelection();
if (!tableId || !recordId) throw new Error("选区状态读取失败");
const table = await bitable.base.getTableById(tableId);
const amountValue = (await table.getCellValue(
id.amountId,
recordId
));
const sortValue = (await table.getCellValue(
id.sortId,
recordId
));
const tagValue = (await table.getCellValue(
id.tagFieldId,
recordId
));
const checkedValue = (await table.getCellValue(
id.checkedFieldId,
recordId
));
return {
tag: tagValue[0]?.text ?? "error",
amount: amountValue,
checked: checkedValue,
};
}
const addRecord = async () => {
const confirmRecord = async () => {
const tableId = formData.value.table;
if (tableId) {
const table = await bitable.base.getTableById(tableId);
@ -45,9 +88,11 @@ import { Minus, Plus } from '@element-plus/icons-vue';
});
return {
formData,
tableMetaList,
addRecord,
tag,
amount,
message,
sort,
confirmRecord,
};
},
};
@ -55,10 +100,13 @@ import { Minus, Plus } from '@element-plus/icons-vue';
<template>
<div>
<el-text id="id-msg" class="mx-1" type="success">Success</el-text>
<el-text class="mx-1" type="success">{{ message }}</el-text>
</div>
<div>
<h1 id="id-tag">Tag</h1>
<p> {{ sort }} </p>
</div>
<div>
<h1>{{ tag }}</h1>
</div>
<div>
<el-input-number v-model="amount" :min="0" :step="1" @change="handleChange" size="large" />
@ -66,7 +114,7 @@ import { Minus, Plus } from '@element-plus/icons-vue';
<div>
<el-button round @click="addRecord">返回</el-button>
<el-button type="warning" round @click="addRecord">待定</el-button>
<el-button type="success" round @click="addRecord">确认</el-button>
<el-button type="success" round @click="confirmRecord">确认</el-button>
</div>
</template>