2025-10-21 17:43:57 +08:00
|
|
|
<!-- 常用取值 -->
|
|
|
|
|
<template>
|
2025-11-04 17:54:29 +08:00
|
|
|
<div>
|
2025-10-28 16:22:44 +08:00
|
|
|
<div class="modifyClass">
|
2025-11-07 17:50:06 +08:00
|
|
|
<el-button type="primary" @click="bClickAdd">增加</el-button>
|
|
|
|
|
<el-button type="primary" @click="bClickDel">删除</el-button>
|
2025-10-28 16:22:44 +08:00
|
|
|
</div>
|
|
|
|
|
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
2025-11-07 17:50:06 +08:00
|
|
|
:config="tableConfig">
|
|
|
|
|
<template #qz>
|
|
|
|
|
<el-select v-model="selectValue" clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in options"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</template>
|
|
|
|
|
</CustomTable>
|
2025-10-28 16:22:44 +08:00
|
|
|
</div>
|
2025-10-21 17:43:57 +08:00
|
|
|
</template>
|
|
|
|
|
|
2025-10-24 15:37:24 +08:00
|
|
|
<script setup lang="ts">
|
2025-10-28 16:22:44 +08:00
|
|
|
import CustomTable from '@/components/elTable/index.vue'
|
2025-11-07 17:50:06 +08:00
|
|
|
import { dictData,getDictData } from '@/hooks';
|
|
|
|
|
import { XmValNew } from '@/types';
|
2025-10-21 17:43:57 +08:00
|
|
|
|
|
|
|
|
const props = defineProps({
|
2025-11-07 17:50:06 +08:00
|
|
|
formData: {
|
|
|
|
|
type: Object,
|
|
|
|
|
default: {}
|
|
|
|
|
}
|
2025-10-21 17:43:57 +08:00
|
|
|
});
|
2025-10-28 16:22:44 +08:00
|
|
|
|
|
|
|
|
const tableRef = ref<any>(null);
|
|
|
|
|
const dataList = ref();
|
|
|
|
|
const columns = ref([
|
2025-11-07 17:50:06 +08:00
|
|
|
{ prop: 'qz', label: '取值', visible: true, align: 'center', slot:'qz', width: 200 },
|
2025-10-28 16:22:44 +08:00
|
|
|
{ prop: 'srm', label: '快速输入码', visible: true, align: 'center', width: 100 },
|
|
|
|
|
{ prop: 'jgbz', label: '结果标志', visible: true, align: 'center', width: 100 }
|
|
|
|
|
]);
|
|
|
|
|
const tableConfig = ref({
|
|
|
|
|
border: true, // 边框
|
|
|
|
|
height: '80vh', // 高度
|
|
|
|
|
highlightCurrentRow: true, // 高亮当前行
|
|
|
|
|
// cellStyle: cellStyleHd
|
|
|
|
|
})
|
2025-11-07 17:50:06 +08:00
|
|
|
const options = ref()
|
|
|
|
|
const selectValue = ref()
|
2025-10-28 16:22:44 +08:00
|
|
|
|
|
|
|
|
//退拽属性
|
|
|
|
|
const handleColumnDragEnd = (data: any) => {
|
|
|
|
|
// 更新列配置
|
|
|
|
|
columns.value = data.columns;
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-07 17:50:06 +08:00
|
|
|
const init = () => {
|
|
|
|
|
options.value = {...dictData.value}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const bClickAdd = () => {
|
|
|
|
|
const newData: XmValNew = {
|
|
|
|
|
xmid: props.formData.xmid,
|
|
|
|
|
qz: ''
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dataList.value.push(newData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const bClickDel = () => {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(()=>{
|
|
|
|
|
//默认取值
|
|
|
|
|
getDictData('VA')
|
|
|
|
|
init()
|
|
|
|
|
})
|
2025-10-28 16:22:44 +08:00
|
|
|
|
|
|
|
|
|
2025-10-21 17:43:57 +08:00
|
|
|
</script>
|