Files
FreeERP.Applet/miniprogram/pages/components/sort-plugin/sort-plugin.ts

40 lines
683 B
TypeScript
Raw Normal View History

2026-01-28 16:00:56 +08:00
import { getDataSet } from '@/utils/util';
Component({
/**
*
*/
properties: {
options: Array,
value: null,
},
/**
*
*/
data: {
visible: false,
},
/**
*
*/
methods: {
open() {
this.setData({ visible: true });
},
onClose() {
this.setData({ visible: false });
},
select(e: any) {
const dataset = getDataSet(e);
const index = dataset.index;
const item = this.data.options[index];
const order = dataset.order;
this.triggerEvent('ok', { value: item.value + ' ' + order });
this.onClose();
},
},
});