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

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

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"dependi.npm.lockFileEnabled": false
}

View File

@ -1,36 +1,79 @@
<script> <script>
import { bitable } from '@lark-opdev/block-bitable-api'; import {
bitable
} from "@lark-opdev/block-bitable-api";
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import { import {
ElButton, ElButton,
ElForm, ElInputNumber,
ElFormItem,
ElSelect,
ElOption,
ElText, ElText,
} from 'element-plus'; } from 'element-plus';
import { Minus, Plus } from '@element-plus/icons-vue';
export default { export default {
components: { components: {
ElButton, ElButton,
ElForm, ElInputNumber,
ElFormItem,
ElSelect,
ElOption,
ElText, ElText,
}, },
setup() { setup() {
const amount = ref(1) const waimoId = {
const handleChange = (value) => { tableId: 'tbluSufkcQm0noBz',
console.log(value) 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 getRecordId = async (id) => {
const tableMetaList = ref([]); 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; const tableId = formData.value.table;
if (tableId) { if (tableId) {
const table = await bitable.base.getTableById(tableId); const table = await bitable.base.getTableById(tableId);
@ -45,9 +88,11 @@ import { Minus, Plus } from '@element-plus/icons-vue';
}); });
return { return {
formData, tag,
tableMetaList, amount,
addRecord, message,
sort,
confirmRecord,
}; };
}, },
}; };
@ -55,10 +100,13 @@ import { Minus, Plus } from '@element-plus/icons-vue';
<template> <template>
<div> <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>
<div> <div>
<h1 id="id-tag">Tag</h1> <p> {{ sort }} </p>
</div>
<div>
<h1>{{ tag }}</h1>
</div> </div>
<div> <div>
<el-input-number v-model="amount" :min="0" :step="1" @change="handleChange" size="large" /> <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> <div>
<el-button round @click="addRecord">返回</el-button> <el-button round @click="addRecord">返回</el-button>
<el-button type="warning" 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> </div>
</template> </template>

67
id.txt
View File

@ -173,7 +173,7 @@ https://open.feishu.cn/open-apis/bitable/v1/apps/EciWbKOEXa68HIsnh5Ac7vZgnff/tab
{ {
"field_id": "fldi4luuNx", "field_id": "fldi4luuNx",
"field_name": "内库数量", "field_name": "内库数量",
"is_hidden": false, "is_hidden": true,
"is_primary": false, "is_primary": false,
"property": { "property": {
"formatter": "0" "formatter": "0"
@ -184,7 +184,7 @@ https://open.feishu.cn/open-apis/bitable/v1/apps/EciWbKOEXa68HIsnh5Ac7vZgnff/tab
{ {
"field_id": "fldZWiGZXA", "field_id": "fldZWiGZXA",
"field_name": "已发放", "field_name": "已发放",
"is_hidden": false, "is_hidden": true,
"is_primary": false, "is_primary": false,
"property": { "property": {
"formatter": "0" "formatter": "0"
@ -192,40 +192,59 @@ https://open.feishu.cn/open-apis/bitable/v1/apps/EciWbKOEXa68HIsnh5Ac7vZgnff/tab
"type": 2, "type": 2,
"ui_type": "Number" "ui_type": "Number"
}, },
{
"field_id": "fldJkHhQgQ",
"field_name": "已盘",
"is_hidden": true,
"is_primary": false,
"property": null,
"type": 7,
"ui_type": "Checkbox"
},
{
"field_id": "fldNX4fdT2",
"field_name": "盘库人",
"is_hidden": true,
"is_primary": false,
"property": {
"multiple": false
},
"type": 11,
"ui_type": "User"
},
{ {
"field_id": "fld42z5rhX", "field_id": "fld42z5rhX",
"field_name": "日期", "field_name": "日期",
"is_hidden": true, "is_hidden": false,
"is_primary": false, "is_primary": false,
"property": { "property": {
"date_formatter": "yyyy/MM/dd" "date_formatter": "yyyy/MM/dd"
}, },
"type": 1002, "type": 1002,
"ui_type": "ModifiedTime" "ui_type": "ModifiedTime"
},
{
"field_id": "fldgsRl1q5",
"field_name": "排序",
"is_hidden": false,
"is_primary": false,
"property": {
"auto_serial": {
"type": "auto_increment_number"
}
},
"type": 1005,
"ui_type": "AutoNumber"
},
{
"field_id": "fldVeLbl8I",
"field_name": "已盘",
"is_hidden": false,
"is_primary": false,
"property": null,
"type": 7,
"ui_type": "Checkbox"
} }
], ],
"page_token": "fld42z5rhX", "page_token": "fldVeLbl8I",
"total": 9 "total": 9
}, },
"msg": "success" "msg": "success"
}
{
"view_id": "vewLYvBFns",
"field_names": [
"规格",
"外库数量",
"排序",
"已盘"
],
"sort": [
{
"field_name": "排序",
"desc": false
}
],
"automatic_fields": true
} }