|
@@ -1,45 +1,42 @@
|
|
|
<template>
|
|
|
- <div v-if="showRegisterDialog" class="dialog">
|
|
|
+ <Dialog v-model="showRegisterDialog" type="md" title="任务登记" hide-footer>
|
|
|
<div class="dialog-content">
|
|
|
- <div class="dialog-header">
|
|
|
- <span>任务登记</span>
|
|
|
- <button @click="closeDialog">×</button>
|
|
|
- </div>
|
|
|
-
|
|
|
<div class="dialog-body">
|
|
|
- <div class="form-group">
|
|
|
- <label>任务内容:</label>
|
|
|
- <!-- <textarea v-model="newTask.description" placeholder="请输入相关任务描述"></textarea>-->
|
|
|
- <el-input
|
|
|
- v-model="newTask.task_description"
|
|
|
- style="font-size: 36px; width: 100%"
|
|
|
- :rows="1"
|
|
|
- type="textarea"
|
|
|
- placeholder="请输入相关任务描述"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div class="form-group">
|
|
|
- <label>执行单位:</label>
|
|
|
- <!-- <select v-model="newTask.unit">
|
|
|
- <option disabled value="">请选择执行单位</option>
|
|
|
- <option v-for="unit in units" :key="unit.value" :value="unit.value">{{ unit.label }}</option>
|
|
|
- </select>-->
|
|
|
- <el-select v-model="newTask.unit_name" placeholder="请选择执行单位" class="custom-el-select" style="width: 100%">
|
|
|
- <el-option v-for="unit in units" :key="unit.value" :label="unit.label" :value="unit.value" />
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
- <div class="form-group">
|
|
|
- <label>登记人:</label>
|
|
|
- <input v-model="newTask.registrar" type="text" readonly />
|
|
|
- </div>
|
|
|
+ <el-form ref="taskFormRef" :model="newTask">
|
|
|
+ <el-form-item label="任务内容" label-width="200px">
|
|
|
+ <el-input
|
|
|
+ v-model="newTask.task_description"
|
|
|
+ class="custom-input2"
|
|
|
+ clearable
|
|
|
+ placeholder="请输入相关任务描述"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="执行单位" label-width="200px">
|
|
|
+ <el-select
|
|
|
+ v-model="newTask.unit_name"
|
|
|
+ placeholder="全部"
|
|
|
+ class="custom-select"
|
|
|
+ size="large"
|
|
|
+ popper-class="custom-select-popper"
|
|
|
+ :teleported="false"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option v-for="unit in units" :key="unit.value" :label="unit.label" :value="unit.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="登记人" label-width="200px">
|
|
|
+ <el-input v-model="newTask.registrar" class="custom-input2" type="text" readonly />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
</div>
|
|
|
-
|
|
|
<div class="dialog-footer">
|
|
|
- <button @click="confirmRegister">确定</button>
|
|
|
- <button @click="closeDialog">取消</button>
|
|
|
+ <div class="flex">
|
|
|
+ <div class="common-btn-primary" @click="confirmRegister" style="margin-top: -32px">确定</div>
|
|
|
+ <div class="common-btn" @click="closeDialog">取消</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </Dialog>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
@@ -50,7 +47,7 @@ const showRegisterDialog = ref(true);
|
|
|
const newTask = reactive({
|
|
|
task_description: '',
|
|
|
unit_name: '',
|
|
|
- registrar: '当前用户' // 这里应该是从全局状态或API获取的当前用户
|
|
|
+ registrar: '当前用户'
|
|
|
});
|
|
|
const units = ref([]);
|
|
|
|
|
@@ -58,12 +55,11 @@ const props = defineProps<{
|
|
|
eventId?: string;
|
|
|
}>();
|
|
|
|
|
|
-// 获取单位数据
|
|
|
const fetchUnits = async () => {
|
|
|
try {
|
|
|
const response = await getUnits();
|
|
|
if (response.code === 200) {
|
|
|
- units.value = response.data; // 假设返回的数据是数组 [{ label: '单位A', value: 'unitA' }, ...]
|
|
|
+ units.value = response.data;
|
|
|
} else {
|
|
|
console.error('获取单位数据失败:', response.msg);
|
|
|
}
|
|
@@ -72,15 +68,12 @@ const fetchUnits = async () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-// 定义事件发射器
|
|
|
const emit = defineEmits(['update:show']);
|
|
|
|
|
|
-// 对话框关闭时执行的操作
|
|
|
const closeDialog = () => {
|
|
|
emit('update:show', false);
|
|
|
};
|
|
|
|
|
|
-// 确认登记任务
|
|
|
const confirmRegister = async () => {
|
|
|
try {
|
|
|
newTask.event_code = props.eventId;
|
|
@@ -96,90 +89,106 @@ const confirmRegister = async () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-// 在组件挂载时获取单位数据
|
|
|
onMounted(() => {
|
|
|
fetchUnits();
|
|
|
});
|
|
|
-
|
|
|
-// 监听 eventId 的变化
|
|
|
-watch(
|
|
|
- () => props.eventId,
|
|
|
- () => {
|
|
|
- if (!!props.eventId) {
|
|
|
- console.log('Received eventId in RenWuDengJi3333:', props.eventId);
|
|
|
- }
|
|
|
- }
|
|
|
-);
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.dialog {
|
|
|
+.dialog-wrap {
|
|
|
position: fixed;
|
|
|
- top: 50%;
|
|
|
- left: 50%;
|
|
|
- transform: translate(-50%, -50%);
|
|
|
- background-color: white;
|
|
|
- border-radius: 8px;
|
|
|
- box-shadow: 0 50px 50px rgba(0, 0, 0, 0.1);
|
|
|
- width: 1500px;
|
|
|
-}
|
|
|
-
|
|
|
-.dialog-header {
|
|
|
+ top: 0;
|
|
|
+ right: 0;
|
|
|
+ left: 0;
|
|
|
+ bottom: 0;
|
|
|
+ z-index: 2000;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
display: flex;
|
|
|
- justify-content: space-between;
|
|
|
align-items: center;
|
|
|
- border-bottom: 1px solid #eee;
|
|
|
- padding: 10px;
|
|
|
-}
|
|
|
-
|
|
|
-.dialog-body {
|
|
|
- padding: 10px;
|
|
|
+ justify-content: center;
|
|
|
+ .overlay {
|
|
|
+ background-color: rgba(0, 0, 0, 0.5);
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ z-index: -1;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ .dialog {
|
|
|
+ width: 5000px;
|
|
|
+ height: 2000px;
|
|
|
+ margin: 0 auto;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 20px;
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
-.form-group {
|
|
|
- margin-bottom: 15px;
|
|
|
+.dialog {
|
|
|
+ padding: 0 50px;
|
|
|
+ .dialog-header {
|
|
|
+ width: 100%;
|
|
|
+ height: 150px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ .icon-close {
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
-.dialog-footer {
|
|
|
+.footer {
|
|
|
+ height: 64px;
|
|
|
display: flex;
|
|
|
justify-content: flex-end;
|
|
|
- padding: 10px;
|
|
|
-}
|
|
|
-
|
|
|
-button {
|
|
|
- margin-left: 10px;
|
|
|
- padding: 5px 15px;
|
|
|
- border: none;
|
|
|
- background-color: #3498db;
|
|
|
- color: white;
|
|
|
- border-radius: 4px;
|
|
|
- cursor: pointer;
|
|
|
- font-size: 36px;
|
|
|
-}
|
|
|
-
|
|
|
-button:hover {
|
|
|
- background-color: #2980b9;
|
|
|
-}
|
|
|
-
|
|
|
-textarea,
|
|
|
-select,
|
|
|
-input[type='text'] {
|
|
|
- width: 100%;
|
|
|
- box-sizing: border-box;
|
|
|
- padding: 5px;
|
|
|
- margin-top: 5px;
|
|
|
- border-radius: 4px;
|
|
|
- border: 1px solid #ccc;
|
|
|
- font-size: 36px;
|
|
|
-}
|
|
|
-.custom-el-select {
|
|
|
- :deep(.el-select__wrapper) {
|
|
|
- height: 60px; // 根据你的字体大小适配高度
|
|
|
- line-height: 60px; // 保持与高度一致
|
|
|
- font-size: 36px;
|
|
|
+ margin-bottom: 30px;
|
|
|
+ .pagination-container {
|
|
|
+ height: 64px;
|
|
|
+ margin: 0;
|
|
|
}
|
|
|
- :deep(.el-select__placeholder) {
|
|
|
- font-size: 36px;
|
|
|
+ :deep(.el-pagination__total) {
|
|
|
+ color: #a7ccdf;
|
|
|
+ font-size: 32px;
|
|
|
}
|
|
|
+ :deep(.el-pagination) {
|
|
|
+ .btn-next,
|
|
|
+ .btn-prev {
|
|
|
+ background-color: transparent;
|
|
|
+ border: none;
|
|
|
+ .el-icon {
|
|
|
+ font-size: 22px;
|
|
|
+ color: #a7ccdf;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .btn-prev:disabled,
|
|
|
+ .btn-next:disabled {
|
|
|
+ background-color: transparent;
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
+ .el-pager li {
|
|
|
+ width: 64px;
|
|
|
+ height: 64px;
|
|
|
+ line-height: 64px;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 32px;
|
|
|
+ color: #a7ccdf;
|
|
|
+ background-color: #0e3064;
|
|
|
+ border: 1px solid #0c57a7;
|
|
|
+ margin: 0 6px;
|
|
|
+ &:hover {
|
|
|
+ background-color: #038dff;
|
|
|
+ border: 1px solid #038dff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .el-pager li.is-active {
|
|
|
+ background-color: #038dff;
|
|
|
+ border: 1px solid #038dff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.flex {
|
|
|
+ display: flex;
|
|
|
+ align-items: flex-start;
|
|
|
}
|
|
|
</style>
|