2025-11-03 18:07:12 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<!-- 计算项目表达式生成向导 -->
|
2025-11-04 15:14:07 +08:00
|
|
|
|
<el-dialog :model-value="visible" @update:model-value="handleVisibleChange" title="计算项目表达式生成向导" width="400px" @close="onClose">
|
|
|
|
|
|
<el-row>
|
2025-11-03 18:07:12 +08:00
|
|
|
|
<el-input type="textarea" v-model="inputText"></el-input>
|
2025-11-04 15:14:07 +08:00
|
|
|
|
<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>
|
2025-11-03 18:07:12 +08:00
|
|
|
|
</el-row>
|
2025-11-04 15:14:07 +08:00
|
|
|
|
<!-- 底部按钮(可选) -->
|
|
|
|
|
|
<template #footer>
|
|
|
|
|
|
<el-button @click="handleCancel">取消</el-button>
|
|
|
|
|
|
<el-button type="primary" @click="handleOk">确定</el-button>
|
|
|
|
|
|
</template>
|
2025-11-03 18:07:12 +08:00
|
|
|
|
</el-dialog>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
import CustomTable from '@/components/elTable/index.vue'
|
|
|
|
|
|
|
2025-11-04 15:14:07 +08:00
|
|
|
|
let visible = ref<boolean>()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const tableData = ref()
|
2025-11-03 18:07:12 +08:00
|
|
|
|
const inputText = ref('')
|
2025-11-04 15:14:07 +08:00
|
|
|
|
const emit = defineEmits(['update:model-value', 'confirm'])
|
2025-11-03 18:07:12 +08:00
|
|
|
|
|
2025-11-04 15:14:07 +08:00
|
|
|
|
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
|
|
|
|
|
|
}
|
|
|
|
|
|
)
|
2025-11-03 18:07:12 +08:00
|
|
|
|
|
2025-11-04 15:14:07 +08:00
|
|
|
|
const handleColumnDragEnd = (newColumns: any) => {
|
|
|
|
|
|
columns.value = newColumns.columns
|
2025-11-03 18:07:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-04 15:14:07 +08:00
|
|
|
|
const rowHandle = () => {
|
2025-11-03 18:07:12 +08:00
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-04 15:14:07 +08:00
|
|
|
|
const onClose = () => {
|
|
|
|
|
|
emit('update:model-value', false)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const handleOk = () => {
|
|
|
|
|
|
emit('confirm',inputText.value) // 通知外部执行确认操作
|
|
|
|
|
|
emit('update:model-value', false) // 确认后关闭
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-03 18:07:12 +08:00
|
|
|
|
const handleCancel = () => {
|
2025-11-04 15:14:07 +08:00
|
|
|
|
emit('update:model-value', false)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const handleVisibleChange = (newVisible: boolean) => {
|
|
|
|
|
|
// 通知父组件:状态变为 newVisible(可能是 true 或 false)
|
|
|
|
|
|
emit('update:model-value', newVisible)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const bClickAdd = () => {
|
2025-11-03 18:07:12 +08:00
|
|
|
|
|
|
|
|
|
|
}
|
2025-11-04 15:14:07 +08:00
|
|
|
|
|
|
|
|
|
|
const bClickSub = () => {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const bClickMul = () => {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const bClickDiv = () => {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const bClickLeft = () => {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const bClickRight = () => {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const bClickPower = () => {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-03 18:07:12 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|
</style>
|