mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-22 17:26:46 +08:00
取消默认阶段以及题干问题
This commit is contained in:
@@ -71,28 +71,58 @@
|
||||
</a-drawer>
|
||||
</template>
|
||||
<script setup>
|
||||
import {defineEmits, defineProps, ref} from "vue";
|
||||
import {defineEmits, defineProps, ref, watch} from "vue";
|
||||
import VoteQuestion from "./VoteQuestion.vue";
|
||||
|
||||
defineProps({
|
||||
options: []
|
||||
const prop = defineProps({
|
||||
options: [],
|
||||
list: []
|
||||
})
|
||||
const emit = defineEmits({})
|
||||
const formData = ref({list: []})
|
||||
const formData = ref({list: [{}]})
|
||||
const initData = ref({list: [{}]})
|
||||
|
||||
console.log(prop.options.length);
|
||||
|
||||
const visible = ref(false)
|
||||
|
||||
function openDrawer() {
|
||||
|
||||
if (prop.options.length > 0) {
|
||||
|
||||
for(let i in initData.value) {
|
||||
console.log(formData.value[i])
|
||||
if (initData.value[i].valueSingle != formData.value[i].valueSingle) {
|
||||
console.log('不等于')
|
||||
formData.value[i].valueSingle = initData.value[i].valueSingle
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
formData.value.list = []
|
||||
setTimeout(() =>{
|
||||
formData.value.list = [{}]
|
||||
}, 100)
|
||||
}
|
||||
visible.value = true
|
||||
}
|
||||
|
||||
watch(formData.value, () => {
|
||||
console.log('111',formData.value)
|
||||
})
|
||||
|
||||
const closeDrawer = () => {
|
||||
console.log('formData',formData.value)
|
||||
// formData.value = JSON.parse(JSON.stringify(initData.value));
|
||||
visible.value = false
|
||||
};
|
||||
|
||||
async function confirm() {
|
||||
console.log('confirm');
|
||||
initData.value = JSON.parse(JSON.stringify(formData.value));
|
||||
emit('update:options', formData.value.list)
|
||||
closeDrawer()
|
||||
// closeDrawer()
|
||||
visible.value = false
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
|
||||
Reference in New Issue
Block a user