110 lines
2.7 KiB
Vue
110 lines
2.7 KiB
Vue
<template>
|
||
<!-- 计算项目表达式生成向导 -->
|
||
<el-dialog :model-value="visible" @update:model-value="handleVisibleChange" title="计算项目表达式生成向导" width="400px" @close="onClose">
|
||
<el-row>
|
||
<el-input type="textarea" v-model="inputText"></el-input>
|
||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig"
|
||
@row-click="rowHandle" :enableColumnDrag="true"
|
||
@column-drag-end="handleColumnDragEnd"/>
|
||
<el-button type="" @click="bClickAdd">+ 加</el-button>
|
||
<el-button type="" @click="bClickSub">- 减</el-button>
|
||
<el-button type="" @click="bClickMul">* 乘</el-button>
|
||
<el-button type="" @click="bClickDiv">/ 除</el-button>
|
||
<el-button type="" @click="bClickLeft">(</el-button>
|
||
<el-button type="" @click="bClickRight">)</el-button>
|
||
<el-button type="" @click="bClickPower">^次方</el-button>
|
||
<el-button type="" @click="">性别</el-button>
|
||
<el-button type="" @click="">年龄</el-button>
|
||
</el-row>
|
||
<!-- 底部按钮(可选) -->
|
||
<template #footer>
|
||
<el-button @click="handleCancel">取消</el-button>
|
||
<el-button type="primary" @click="handleOk">确定</el-button>
|
||
</template>
|
||
</el-dialog>
|
||
</template>
|
||
|
||
<script setup lang="ts">
|
||
import CustomTable from '@/components/elTable/index.vue'
|
||
|
||
let visible = ref<boolean>()
|
||
|
||
|
||
const tableData = ref()
|
||
const inputText = ref('')
|
||
const emit = defineEmits(['update:model-value', 'confirm'])
|
||
|
||
const columns = ref([
|
||
{ prop: 'xmdh', label: '项目代号', align: 'center', visible: true, width: 100 },
|
||
{ prop: 'xmmc', label: '项目名称', align: 'center', visible: true, width: 100 }
|
||
])
|
||
// 表格配置
|
||
const tableConfig = ref(
|
||
{
|
||
// stripe: true, // 斑马纹
|
||
border: true, // 边框
|
||
height: '', // 高度
|
||
highlightCurrentRow: true, // 高亮当前行
|
||
fit: true
|
||
}
|
||
)
|
||
|
||
const handleColumnDragEnd = (newColumns: any) => {
|
||
columns.value = newColumns.columns
|
||
}
|
||
|
||
const rowHandle = () => {
|
||
|
||
}
|
||
|
||
const onClose = () => {
|
||
emit('update:model-value', false)
|
||
}
|
||
|
||
const handleOk = () => {
|
||
emit('confirm',inputText.value) // 通知外部执行确认操作
|
||
emit('update:model-value', false) // 确认后关闭
|
||
}
|
||
|
||
const handleCancel = () => {
|
||
emit('update:model-value', false)
|
||
}
|
||
|
||
const handleVisibleChange = (newVisible: boolean) => {
|
||
// 通知父组件:状态变为 newVisible(可能是 true 或 false)
|
||
emit('update:model-value', newVisible)
|
||
}
|
||
|
||
const bClickAdd = () => {
|
||
|
||
}
|
||
|
||
const bClickSub = () => {
|
||
|
||
}
|
||
|
||
const bClickMul = () => {
|
||
|
||
}
|
||
|
||
const bClickDiv = () => {
|
||
|
||
}
|
||
|
||
const bClickLeft = () => {
|
||
|
||
}
|
||
|
||
const bClickRight = () => {
|
||
|
||
}
|
||
|
||
const bClickPower = () => {
|
||
|
||
}
|
||
|
||
</script>
|
||
|
||
<style scoped lang="scss">
|
||
</style>
|