|
|
|
@ -76,10 +76,13 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script lang="ts" setup> |
|
|
|
|
import { reactive, ref } from 'vue' |
|
|
|
|
import { reactive, ref, onMounted ,watch} from 'vue' |
|
|
|
|
import stuDialog from './stuDialog.vue' |
|
|
|
|
import { ClusterOutlined } from '@ant-design/icons-vue' |
|
|
|
|
import { ElMessage } from 'element-plus' |
|
|
|
|
import userStore from '@/store/module/user' |
|
|
|
|
const userModel = userStore() |
|
|
|
|
|
|
|
|
|
const options = [ |
|
|
|
|
{ |
|
|
|
|
value: '1', |
|
|
|
@ -93,12 +96,29 @@ const options = [ |
|
|
|
|
|
|
|
|
|
// 数据 |
|
|
|
|
const tableData = reactive<any[]>([]) |
|
|
|
|
|
|
|
|
|
// onMounted(() => { |
|
|
|
|
// setTimeout(() => { |
|
|
|
|
// tableData.push({ |
|
|
|
|
// userId: userModel.userInfo.id, |
|
|
|
|
// realname: userModel.userInfo.realname, |
|
|
|
|
// captain: '1', |
|
|
|
|
// teamSeq: 1, |
|
|
|
|
// }) |
|
|
|
|
// }, 50) |
|
|
|
|
// }) |
|
|
|
|
watch(()=>userModel.userInfo,()=>{ |
|
|
|
|
tableData.push({ |
|
|
|
|
userId: userModel.userInfo.id, |
|
|
|
|
realname: userModel.userInfo.realname, |
|
|
|
|
captain: '1', |
|
|
|
|
teamSeq: 1, |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
const add = () => { |
|
|
|
|
const length = tableData.push({ |
|
|
|
|
realname: '', // 用户 |
|
|
|
|
captain: '', // 是否队长 |
|
|
|
|
teamSeq: '', // 队员序号 |
|
|
|
|
teamSeq: tableData.length + 1, // 队员序号 |
|
|
|
|
userId: '', // id |
|
|
|
|
}) |
|
|
|
|
openDialog(tableData[length - 1]) |
|
|
|
|