|
@@ -20,6 +20,8 @@
|
|
import { optionsListApi } from '/@/api/demo/select';
|
|
import { optionsListApi } from '/@/api/demo/select';
|
|
|
|
|
|
import { demoListApi } from '/@/api/demo/table';
|
|
import { demoListApi } from '/@/api/demo/table';
|
|
|
|
+ const optionsData = ref([]);
|
|
|
|
+
|
|
const columns: BasicColumn[] = [
|
|
const columns: BasicColumn[] = [
|
|
{
|
|
{
|
|
title: '输入框',
|
|
title: '输入框',
|
|
@@ -98,6 +100,17 @@
|
|
resultField: 'list',
|
|
resultField: 'list',
|
|
labelField: 'name',
|
|
labelField: 'name',
|
|
valueField: 'id',
|
|
valueField: 'id',
|
|
|
|
+ onOptionsChange(options) {
|
|
|
|
+ optionsData.value = options;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ editValueMap(value: any) {
|
|
|
|
+ const found = optionsData.value.find((option) => option.id === value);
|
|
|
|
+ if (found) {
|
|
|
|
+ return found.name;
|
|
|
|
+ } else {
|
|
|
|
+ return value;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
width: 200,
|
|
width: 200,
|
|
},
|
|
},
|
|
@@ -149,7 +162,6 @@
|
|
components: { BasicTable, TableAction },
|
|
components: { BasicTable, TableAction },
|
|
setup() {
|
|
setup() {
|
|
const currentEditKeyRef = ref('');
|
|
const currentEditKeyRef = ref('');
|
|
-
|
|
|
|
const [registerTable] = useTable({
|
|
const [registerTable] = useTable({
|
|
title: '可编辑行示例',
|
|
title: '可编辑行示例',
|
|
titleHelpMessage: [
|
|
titleHelpMessage: [
|