提交 b497947d 编写于 作者: 水晶土豆

Fri Nov 17 12:13:00 CST 2023 inscode

上级 31b59479
<script setup>
import { ref, computed, watch, onMounted } from 'vue';
const tableData = ref([{ name: "普通合同" },{name:"协同合同"}]);
const props = defineProps(['addselectContractList'])
const emit = defineEmits(['update:addselectContractList'])
const currentRow = ref()
const tTable = ref();
onMounted(()=>{
tTable.value.setCurrentRow(tableData.value[0])
})
watch(()=>currentRow.this,(val)=>{
emit('update:addselectContractList',val)
})
const handleCurrentChange = (val) => {
currentRow.value = val.name
}
</script>
<template>
<el-radio-group v-model="currentRow">
<el-table ref='tTable' :data="tableData" border highlight-current-row @current-change="handleCurrentChange">
<el-table-column label="选择" width="100px" align="center">
<template #default="{ row }">
<el-radio :label="row.name">{{ '' }}</el-radio>
</template>
</el-table-column>
<el-table-column label="名称" prop="name"></el-table-column>
</el-table>
</el-radio-group>
</template>
<style scoped>
.el-radio-group {
width: 100%;
}
::v-deep(.el-table__body tr.current-row > td) {
background: #bbf4e0;
}
</style>
\ No newline at end of file
<script setup>
import { ref, watch } from 'vue';
const tableData = ref([{ name: 1 }, { name: 2 }, { name: 3 }, { name: 4 },]);
const radio1 = ref();
watch(()=>radio1.value,()=>{
console.log(radio1.value);
})
</script>
<template>
<el-radio-group v-model="radio1" width="auto">
<el-table :data="tableData">
<el-table-column label="选择">
<template #default="{ row }">
<el-radio :label="row.name">{{ '' }}</el-radio>
</template>
</el-table-column>
<el-table-column label="名称" prop="name"></el-table-column>
</el-table>
</el-radio-group>
</template>
<style scoped></style>
\ No newline at end of file
......@@ -9,7 +9,7 @@ import forms from '@/component/main/header/form.vue';
import contractListForm from './contractListForm.vue';
import { ref, provide, reactive, onMounted } from 'vue';
import { getContractList } from '@/api/api'
import addContractList from './addContractList.vue';
import addContractList from './add/addContractList.vue';
const getData = () => {
contractSelect.value.page = tablePagination.currentPage;
......@@ -77,6 +77,11 @@ const contractSelect = ref({
page: '1',
limit: '10'
});
//添加
const addselectContractList = ref();
//对话框
const addDialog = ref(false);
const addSubcategoriesDialog = ref(false);
......@@ -133,7 +138,7 @@ provide("changeState",()=>{
</mains>
<ejectDialog v-model:open-dialog="addDialog">
<template #header>选择合同性质</template>
<template #default><addContractList></addContractList></template>
<template #default><addContractList v-model:addselectContractList="addselectContractList"></addContractList></template>
</ejectDialog>
<ejectDialog v-model:open-dialog="detailsDialog">
<template #header>合同详情</template>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册