|
@@ -8,6 +8,7 @@
|
|
|
</ol>
|
|
|
<div style="display: flex; justify-content: space-around; margin: 20px 0">
|
|
|
<div v-for="item in types" :key="item.value" @click="select(item.value)" style="cursor: pointer; text-align: center">
|
|
|
+ <img :src="getImage(item.value)" style="width: 80px; height: 80px;" />
|
|
|
<el-button type="primary" style="margin-top: 8px; font-weight: bold" v-if="item.label !== '特殊借用'">{{ item.label }}</el-button>
|
|
|
<el-button type="danger" plain style="margin-top: 8px; font-weight: bold" v-else>{{ item.label }}</el-button>
|
|
|
</div>
|
|
@@ -24,12 +25,26 @@ import { ref, watch, defineProps, defineEmits } from 'vue';
|
|
|
const props = defineProps<{ visible: boolean }>();
|
|
|
const emit = defineEmits(['update:visible', 'select']);
|
|
|
const visible = ref(props.visible);
|
|
|
+import classroomImg from '/@/assets/classroom.png';
|
|
|
+import specialImg from '/@/assets/special.png';
|
|
|
|
|
|
watch(
|
|
|
() => props.visible,
|
|
|
(v) => (visible.value = v)
|
|
|
);
|
|
|
|
|
|
+function getImage(value: number): string {
|
|
|
+ switch (value) {
|
|
|
+ case 1:
|
|
|
+ return classroomImg;
|
|
|
+ case 2:
|
|
|
+ return specialImg;
|
|
|
+ default:
|
|
|
+ return specialImg;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
const types = [
|
|
|
// { value: 0, label: '常规借用' },
|
|
|
{ value: 1, label: '课堂借用' },
|
|
@@ -37,7 +52,7 @@ const types = [
|
|
|
];
|
|
|
|
|
|
function select(type: number) {
|
|
|
- console.log(type);
|
|
|
+ // console.log(type);
|
|
|
emit('select', type);
|
|
|
emit('update:visible', false);
|
|
|
}
|