site_back/src/pages/index/business/faq/components/DetailFaqDialog.vue
2024-05-02 21:28:04 +08:00

93 lines
2.5 KiB
Vue

<template>
<el-dialog v-model="props.modelValue" title="常见问题详情" width="900px" @closed="closeDialog" @open="openDialog">
<el-form ref="formRef" :model="formData" :disabled="true">
<el-row>
<el-col :span="12">
<el-form-item :label-width="labelWidth" label="语言类型" prop="i18n_lang_type_guid">
<el-select v-model="formData.i18n_lang_type_guid" clearable placeholder="请选择">
<el-option v-for="item in i18n_lang_type" :key="item.i18n_lang_type_guid"
:label="item.i18n_lang_type_code" :value="item.i18n_lang_type_guid"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label-width="labelWidth" label="问题" prop="faq_questions">
<el-input v-model='formData.faq_questions' type="text" placeholder='请输入问题'></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :label-width="labelWidth" label="答案" prop="faq_answer">
<el-input v-model='formData.faq_answer' type="textarea" :rows="5" placeholder='请输入答案'></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label-width="labelWidth" label="顺序" prop="faq_sort">
<el-input-number v-model='formData.faq_sort' controls-position='right' :min='1'></el-input-number>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
</template>
<script setup>
import { reactive, ref, watch } from "vue";
import { isEmptyObject } from "~/utils/index";
import { getI18nLangTypeList } from '~/service/i18n_lang_type';
// --业务参数
// --业务方法
// 语言类型code
const i18n_lang_type = ref();
async function geti18n_lang_typeList() {
getI18nLangTypeList({ limit: 9999 }).then((res) => {
if (res.code == 0) {
i18n_lang_type.value = res.data
}
})
}
// --基础参数
const formRef = ref();
const labelWidth = 100;
const props = defineProps({
modelValue: Boolean,
data: Object,
done: Function,
});
const emits = defineEmits(["update:modelValue"]);
const formData = ref({
...props.data,
});
// --基础方法
watch(props, (v) => {
formData.value = v.data;
});
// 打开弹窗时执行
const openDialog = async () => {
await geti18n_lang_typeList()
};
const closeDialog = () => {
emits("update:modelValue", false);
};
</script>
<style lang="less" scoped></style>