feat:初始化招生问答模块
This commit is contained in:
parent
5b5e789234
commit
7a7966c427
173
src/pages/index/enrol/enrol_aq/components/AddEnrolAqDialog.vue
Normal file
173
src/pages/index/enrol/enrol_aq/components/AddEnrolAqDialog.vue
Normal file
@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" title="添加招生问答" width="900px" @closed="closeDialog" @open="openDialog">
|
||||
<el-form ref="formRef" :model="formData" :rules="rules">
|
||||
<el-row>
|
||||
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item :label-width="labelWidth" label="问题" prop="enrol_aq_question">
|
||||
<el-input v-model='formData.enrol_aq_question' type="textarea" :rows="5" placeholder='请输入问题'></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item :label-width="labelWidth" label="答案" prop="enrol_aq_answer">
|
||||
<el-input v-model='formData.enrol_aq_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="enrol_aq_sort">
|
||||
<el-input-number v-model='formData.enrol_aq_sort' controls-position='right'></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否展示" prop="enrol_aq_status">
|
||||
<el-select v-model="formData.enrol_aq_status" clearable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in show_status"
|
||||
:key="item.dictionary_guid" :label="item.dictionary_name"
|
||||
:value="item.dictionary_value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="回答状态" prop="enrol_aq_answer_status">
|
||||
<el-select v-model="formData.enrol_aq_answer_status" clearable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in answer_status"
|
||||
:key="item.dictionary_guid" :label="item.dictionary_name"
|
||||
:value="item.dictionary_value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button type="primary" @click="handleAddClick(formRef)">添加</el-button>
|
||||
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, watch } from "vue";
|
||||
import { addEnrolAq , getDictionary } from "~/service/enrol_aq";
|
||||
import { useLoginStore } from "~/store";
|
||||
|
||||
// --业务参数
|
||||
|
||||
|
||||
|
||||
// --业务方法
|
||||
|
||||
// 字典获取
|
||||
const show_status = ref([]);
|
||||
async function get_show_status() {
|
||||
await getDictionary({ dictionary_value: 'show_status'}).then((res) => {
|
||||
show_status.value = res
|
||||
})
|
||||
}
|
||||
// 字典获取
|
||||
const answer_status = ref([]);
|
||||
async function get_answer_status() {
|
||||
await getDictionary({ dictionary_value: 'answer_status'}).then((res) => {
|
||||
answer_status.value = res
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// --基础参数
|
||||
const store = useLoginStore();
|
||||
const headers = {
|
||||
Accept: "application/json",
|
||||
...store.headers,
|
||||
};
|
||||
|
||||
const formRef = ref();
|
||||
const labelWidth = 90;
|
||||
const props = defineProps({
|
||||
modelValue: Boolean,
|
||||
done: Function,
|
||||
});
|
||||
const emits = defineEmits(["update:modelValue"]);
|
||||
const dialogVisible = ref(props.modelValue);
|
||||
const formData = reactive({});
|
||||
|
||||
const uoloadData = ref({
|
||||
dirName: "EnrolAq"
|
||||
})
|
||||
|
||||
watch(props, (v) => {
|
||||
dialogVisible.value = v.modelValue;
|
||||
});
|
||||
|
||||
const rules = reactive({
|
||||
enrol_aq_question: [
|
||||
{
|
||||
required: true,
|
||||
message: '问题不能为空'
|
||||
}
|
||||
],
|
||||
enrol_aq_answer: [
|
||||
{
|
||||
required: true,
|
||||
message: '答案不能为空'
|
||||
}
|
||||
],
|
||||
enrol_aq_sort: [
|
||||
{
|
||||
required: true,
|
||||
message: '排序不能为空'
|
||||
}
|
||||
],
|
||||
|
||||
});
|
||||
|
||||
|
||||
// --基础方法
|
||||
|
||||
// 打开弹窗时执行
|
||||
const openDialog = () => {
|
||||
get_show_status()
|
||||
get_answer_status()
|
||||
|
||||
};
|
||||
|
||||
const closeDialog = () => {
|
||||
handleResetClick(formRef.value);
|
||||
dialogVisible.value = false;
|
||||
emits("update:modelValue", false);
|
||||
};
|
||||
|
||||
const handleAddClick = async (formEl) => {
|
||||
console.log(formData);
|
||||
if (!formEl) return;
|
||||
formEl.validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { code } = await addEnrolAq(formData);
|
||||
if (code == 0) {
|
||||
closeDialog();
|
||||
props.done();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleResetClick = async (formEl) => {
|
||||
if (!formEl) return;
|
||||
formEl.resetFields();
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
</style>
|
@ -0,0 +1,115 @@
|
||||
<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="24">
|
||||
<el-form-item :label-width="labelWidth" label="问题" prop="enrol_aq_question">
|
||||
<el-input v-model='formData.enrol_aq_question' type="textarea" :rows="5" placeholder='请输入问题'></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item :label-width="labelWidth" label="答案" prop="enrol_aq_answer">
|
||||
<el-input v-model='formData.enrol_aq_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="enrol_aq_sort">
|
||||
<el-input-number v-model='formData.enrol_aq_sort' controls-position='right'></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否展示" prop="enrol_aq_status">
|
||||
<el-select v-model="formData.enrol_aq_status" clearable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in show_status"
|
||||
:key="item.dictionary_guid" :label="item.dictionary_name"
|
||||
:value="item.dictionary_value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="回答状态" prop="enrol_aq_answer_status">
|
||||
<el-select v-model="formData.enrol_aq_answer_status" clearable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in answer_status"
|
||||
:key="item.dictionary_guid" :label="item.dictionary_name"
|
||||
:value="item.dictionary_value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</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 { getDictionary } from '~/service/enrol_aq';
|
||||
|
||||
// --业务参数
|
||||
|
||||
|
||||
|
||||
// --业务方法
|
||||
|
||||
// 字典获取
|
||||
const show_status = ref([]);
|
||||
async function get_show_status() {
|
||||
await getDictionary({ dictionary_value: 'show_status'}).then((res) => {
|
||||
show_status.value = res
|
||||
})
|
||||
}
|
||||
// 字典获取
|
||||
const answer_status = ref([]);
|
||||
async function get_answer_status() {
|
||||
await getDictionary({ dictionary_value: 'answer_status'}).then((res) => {
|
||||
answer_status.value = res
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
// --基础参数
|
||||
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 = () => {
|
||||
|
||||
get_show_status()
|
||||
get_answer_status()
|
||||
|
||||
};
|
||||
|
||||
const closeDialog = () => {
|
||||
emits("update:modelValue", false);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
</style>
|
171
src/pages/index/enrol/enrol_aq/components/EditEnrolAqDialog.vue
Normal file
171
src/pages/index/enrol/enrol_aq/components/EditEnrolAqDialog.vue
Normal file
@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<el-dialog v-model="props.modelValue" title="编辑招生问答" width="900px" @closed="closeDialog" @open="openDialog">
|
||||
<el-form ref="formRef" :model="formData" :rules="rules">
|
||||
<el-row>
|
||||
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item :label-width="labelWidth" label="问题" prop="enrol_aq_question">
|
||||
<el-input v-model='formData.enrol_aq_question' type="textarea" :rows="5" placeholder='请输入问题'></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item :label-width="labelWidth" label="答案" prop="enrol_aq_answer">
|
||||
<el-input v-model='formData.enrol_aq_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="enrol_aq_sort">
|
||||
<el-input-number v-model='formData.enrol_aq_sort' controls-position='right'></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否展示" prop="enrol_aq_status">
|
||||
<el-select v-model="formData.enrol_aq_status" clearable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in show_status"
|
||||
:key="item.dictionary_guid" :label="item.dictionary_name"
|
||||
:value="item.dictionary_value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="回答状态" prop="enrol_aq_answer_status">
|
||||
<el-select v-model="formData.enrol_aq_answer_status" clearable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in answer_status"
|
||||
:key="item.dictionary_guid" :label="item.dictionary_name"
|
||||
:value="item.dictionary_value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button type="primary" @click="handleEditClick(formRef)">编辑</el-button>
|
||||
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, watch } from "vue";
|
||||
import { editEnrolAq , getDictionary } from "~/service/enrol_aq";
|
||||
import { useLoginStore } from "~/store";
|
||||
|
||||
// --业务参数
|
||||
|
||||
|
||||
|
||||
// --业务方法
|
||||
|
||||
// 字典获取
|
||||
const show_status = ref([]);
|
||||
async function get_show_status() {
|
||||
await getDictionary({ dictionary_value: 'show_status'}).then((res) => {
|
||||
show_status.value = res
|
||||
})
|
||||
}
|
||||
// 字典获取
|
||||
const answer_status = ref([]);
|
||||
async function get_answer_status() {
|
||||
await getDictionary({ dictionary_value: 'answer_status'}).then((res) => {
|
||||
answer_status.value = res
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// --基础参数
|
||||
const store = useLoginStore();
|
||||
const headers = {
|
||||
Accept: "application/json",
|
||||
...store.headers,
|
||||
};
|
||||
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,
|
||||
});
|
||||
const uoloadData = ref({
|
||||
dirName: "EnrolAq"
|
||||
})
|
||||
|
||||
|
||||
// --基础方法
|
||||
watch(props, (v) => {
|
||||
formData.value = v.data;
|
||||
|
||||
|
||||
});
|
||||
|
||||
// 打开弹窗时执行
|
||||
const openDialog = () => {
|
||||
get_show_status()
|
||||
get_answer_status()
|
||||
|
||||
};
|
||||
|
||||
const closeDialog = () => {
|
||||
props.done();
|
||||
emits("update:modelValue", false);
|
||||
};
|
||||
|
||||
const rules = reactive({
|
||||
enrol_aq_question: [
|
||||
{
|
||||
required: true,
|
||||
message: '问题不能为空'
|
||||
}
|
||||
],
|
||||
enrol_aq_answer: [
|
||||
{
|
||||
required: true,
|
||||
message: '答案不能为空'
|
||||
}
|
||||
],
|
||||
enrol_aq_sort: [
|
||||
{
|
||||
required: true,
|
||||
message: '排序不能为空'
|
||||
}
|
||||
],
|
||||
|
||||
});
|
||||
|
||||
const handleEditClick = async (formEl) => {
|
||||
console.log(formData.value);
|
||||
if (!formEl) return;
|
||||
formEl.validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { code } = await editEnrolAq(formData.value);
|
||||
if (code == 0) {
|
||||
closeDialog();
|
||||
props.done();
|
||||
}
|
||||
});
|
||||
};
|
||||
const handleResetClick = async (formEl) => {
|
||||
if (!formEl) return;
|
||||
formEl.resetFields();
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
</style>
|
231
src/pages/index/enrol/enrol_aq/index.vue
Normal file
231
src/pages/index/enrol/enrol_aq/index.vue
Normal file
@ -0,0 +1,231 @@
|
||||
<template>
|
||||
<!-- 面包屑 -->
|
||||
<el-breadcrumb>
|
||||
<el-breadcrumb-item>招生问答管理</el-breadcrumb-item>
|
||||
<el-breadcrumb-item to="/enrol_aq/list">招生问答列表</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
<!-- 搜索 -->
|
||||
<el-form inline :model="params">
|
||||
|
||||
<el-form-item label="问题">
|
||||
<el-input v-model='params.enrol_aq_question' placeholder='请输入问题'></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否展示">
|
||||
<el-select v-model="params.enrol_aq_status" clearable placeholder="请选择">
|
||||
<el-option v-for="item in show_status" :key="item.dictionary_guid" :label="item.dictionary_name"
|
||||
:value="item.dictionary_value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="回答状态">
|
||||
<el-select v-model="params.enrol_aq_answer_status" clearable placeholder="请选择">
|
||||
<el-option v-for="item in answer_status" :key="item.dictionary_guid" :label="item.dictionary_name"
|
||||
:value="item.dictionary_value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="tableRef.reload()" icon="ElIconSearch">
|
||||
搜索
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-space style="margin-bottom: 10px;">
|
||||
<!-- 添加招生问答 -->
|
||||
<el-col :span="1">
|
||||
<el-button type="primary" @click="addEnrolAqDialogVisible = true"> 添加 </el-button>
|
||||
</el-col>
|
||||
|
||||
|
||||
<!-- 导出 -->
|
||||
<el-button icon="ElIconDocument" @click="exportExcel(params)">导出</el-button>
|
||||
|
||||
|
||||
<!-- 下拉操作 -->
|
||||
<el-dropdown v-if="selectionData.length">
|
||||
<el-button type="primary">
|
||||
批量操作<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item @click="handleDelete(selectionData)">
|
||||
批量删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</el-space>
|
||||
<!-- 数据表格 -->
|
||||
<DataTable ref="tableRef" style="width: 100%" :onSelectionChange="data => (selectionData = data)" :column="column"
|
||||
:params="params" :request="params => getEnrolAqList(params)">
|
||||
|
||||
|
||||
<template #enrol_aq_status='scope'>
|
||||
<dict-tag :options='show_status' :value='scope.row.enrol_aq_status' />
|
||||
</template>
|
||||
|
||||
<template #enrol_aq_answer_status='scope'>
|
||||
<dict-tag :options='answer_status' :value='scope.row.enrol_aq_answer_status' />
|
||||
</template>
|
||||
|
||||
<template #chaoz="scope">
|
||||
<el-space>
|
||||
<el-button size="small" @click="handleUpdate(scope.row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-button type="primary" size="small">
|
||||
更多<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item :command="{ type: 'detail', row: scope.row }">
|
||||
详情
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{ type: 'delete', row: scope.row }">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</el-space>
|
||||
</template>
|
||||
</DataTable>
|
||||
|
||||
<!-- 添加招生问答 -->
|
||||
<AddEnrolAqDialog v-model="addEnrolAqDialogVisible" :done="() => tableRef.reload()"></AddEnrolAqDialog>
|
||||
<!-- 编辑招生问答 -->
|
||||
<EditEnrolAqDialog v-model="EditEnrolAqDialogVisible" :data="EditEnrolAqDialogRow" :done="() => tableRef.reload()">
|
||||
</EditEnrolAqDialog>
|
||||
<!-- 招生问答详情 -->
|
||||
<DetailEnrolAqDialog v-model="DetailEnrolAqDialogVisible" :data="DetailEnrolAqDialogRow"></DetailEnrolAqDialog>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ArrowDown } from '@element-plus/icons-vue';
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { useLoginStore } from "~/store";
|
||||
import { getEnrolAqList, deleteEnrolAq, getDictionary, exportExcel } from '~/service/enrol_aq';
|
||||
import AddEnrolAqDialog from './components/AddEnrolAqDialog.vue';
|
||||
import EditEnrolAqDialog from './components/EditEnrolAqDialog.vue';
|
||||
import DetailEnrolAqDialog from './components/DetailEnrolAqDialog.vue';
|
||||
|
||||
const tableRef = ref();
|
||||
const selectionData = ref([]);
|
||||
const store = useLoginStore();
|
||||
|
||||
const addEnrolAqDialogVisible = ref(false);
|
||||
const EditEnrolAqDialogVisible = ref(false);
|
||||
const EditEnrolAqDialogRow = ref({});
|
||||
const DetailEnrolAqDialogVisible = ref(false);
|
||||
const DetailEnrolAqDialogRow = ref({});
|
||||
|
||||
const headers = {
|
||||
Accept: "application/json",
|
||||
...store.headers,
|
||||
};
|
||||
|
||||
// 查询参数
|
||||
const params = reactive({
|
||||
enrol_aq_question: "",
|
||||
enrol_aq_status: "",
|
||||
enrol_aq_answer_status: "",
|
||||
|
||||
});
|
||||
const column = [
|
||||
|
||||
{
|
||||
fixed: true,
|
||||
type: 'selection'
|
||||
},
|
||||
{
|
||||
prop: "enrol_aq_question",
|
||||
label: '问题',
|
||||
width: '200',
|
||||
showOverflowTooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "enrol_aq_answer",
|
||||
label: '答案',
|
||||
width: '200',
|
||||
showOverflowTooltip: true,
|
||||
},
|
||||
{
|
||||
prop: "enrol_aq_sort",
|
||||
label: '排序',
|
||||
width: '150',
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
prop: "enrol_aq_status",
|
||||
label: '是否展示',
|
||||
width: '150',
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
prop: "enrol_aq_answer_status",
|
||||
label: '回答状态',
|
||||
width: '150',
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
label: '操作',
|
||||
prop: 'chaoz',
|
||||
width: '250',
|
||||
fixed: 'right'
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
const handleCommand = ({ type, row }) => {
|
||||
switch (type) {
|
||||
case "detail":
|
||||
handleDetail(row);
|
||||
break;
|
||||
case 'delete':
|
||||
handleDelete([row]);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
// 删除数据
|
||||
const handleDelete = data => {
|
||||
ElMessageBox.confirm(`您确定要删除该招生问答吗?`).then(async () => {
|
||||
const res = await deleteEnrolAq({
|
||||
enrol_aq_guid: data.map(v => v.enrol_aq_guid).join()
|
||||
});
|
||||
if (res) {
|
||||
tableRef.value.reload();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 修改
|
||||
function handleUpdate(row) {
|
||||
EditEnrolAqDialogVisible.value = true
|
||||
EditEnrolAqDialogRow.value = row
|
||||
}
|
||||
|
||||
// 详情
|
||||
function handleDetail(row) {
|
||||
DetailEnrolAqDialogVisible.value = true
|
||||
DetailEnrolAqDialogRow.value = row
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 字典获取
|
||||
const show_status = ref([]);
|
||||
async function get_show_status() {
|
||||
await getDictionary({ dictionary_value: 'show_status' }).then((res) => {
|
||||
show_status.value = res
|
||||
})
|
||||
}
|
||||
get_show_status()
|
||||
// 字典获取
|
||||
const answer_status = ref([]);
|
||||
async function get_answer_status() {
|
||||
await getDictionary({ dictionary_value: 'answer_status' }).then((res) => {
|
||||
answer_status.value = res
|
||||
})
|
||||
}
|
||||
get_answer_status()
|
||||
</script>
|
75
src/service/enrol_aq.js
Normal file
75
src/service/enrol_aq.js
Normal file
@ -0,0 +1,75 @@
|
||||
import { api, downloadFile, createApiUrl } from '~/utils/axios';
|
||||
|
||||
|
||||
/**
|
||||
* 导出招生问答
|
||||
* @param {Object} data
|
||||
* @return {Promise} api
|
||||
*/
|
||||
export function exportExcel(data) {
|
||||
downloadFile(createApiUrl('Enrol.EnrolAq/exportExcel'), data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取字典值
|
||||
* @param {Object} data
|
||||
* @return {Promise} api
|
||||
*/
|
||||
export function getDictionary(data) {
|
||||
return api.post('Dictionary.Dictionary/getDictionary', data, {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取招生问答列表
|
||||
* @param {Object} data
|
||||
* @return {Promise} api
|
||||
*/
|
||||
export function getEnrolAqList(data) {
|
||||
return api.post('Enrol.EnrolAq/getEnrolAqList', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除招生问答
|
||||
* @param {Object} data
|
||||
* @return {Promise} api
|
||||
*/
|
||||
export function deleteEnrolAq(data) {
|
||||
return api.post('Enrol.EnrolAq/deleteEnrolAq', data, {
|
||||
isTransformResponse: true,
|
||||
isShowSuccessMessage: true,
|
||||
errorMessageText: '删除失败'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加招生问答
|
||||
* @param {Object} data
|
||||
* @return {Promise} api
|
||||
*/
|
||||
export function addEnrolAq(data) {
|
||||
return api.post('Enrol.EnrolAq/addEnrolAq', data, {
|
||||
isTransformResponse: true,
|
||||
isShowSuccessMessage: true,
|
||||
errorMessageText: '添加失败'
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 编辑招生问答
|
||||
* @param {Object} data
|
||||
* @return {Promise} api
|
||||
*/
|
||||
export function editEnrolAq(data) {
|
||||
return api.post('Enrol.EnrolAq/editEnrolAq', data, {
|
||||
isTransformResponse: true,
|
||||
isShowSuccessMessage: true,
|
||||
errorMessageText: '编辑失败'
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue
Block a user