feat: 添加报名方式模块
This commit is contained in:
parent
0d6a50095b
commit
675f0cdfdf
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="{ hidden: hidden }" class="pagination-container">
|
<div :class="{ hidden: hidden }" class="pagination-container">
|
||||||
<el-pagination
|
<el-pagination
|
||||||
small
|
large
|
||||||
background
|
background
|
||||||
v-model:current-page="currentPage"
|
v-model:current-page="currentPage"
|
||||||
v-model:page-size="pageSize"
|
v-model:page-size="pageSize"
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
|
|
||||||
<el-form-item label="名称">
|
<el-form-item label="名称">
|
||||||
<el-input v-model='params.classes_name' @keyup.enter.native="getList()" placeholder='请输入名称'></el-input>
|
<el-input v-model='params.classes_name' placeholder='请输入名称'></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="getList()" icon="ElIconSearch">
|
<el-button type="primary" @click="tableRef.reload()" icon="ElIconSearch">
|
||||||
搜索
|
搜索
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -50,33 +50,43 @@
|
|||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</el-space>
|
</el-space>
|
||||||
<!-- 数据表格 -->
|
<!-- 数据表格 -->
|
||||||
<el-table v-loading="loading" :data="dataList" ref="tableRef" border highlight-current-row
|
<DataTable ref="tableRef" style="width: 100%" v-loading="loading"
|
||||||
:onSelectionChange="data => (selectionData = data)" >
|
:onSelectionChange="data => (selectionData = data)" :column="column" :params="params"
|
||||||
<el-table-column type="selection" width="50" align="center" />
|
:request="params => tableDataInit(params)">
|
||||||
<el-table-column prop="classes_name" width="200" label="班型名称" :show-overflow-tooltip="true"> </el-table-column>
|
<!-- 排序 -->
|
||||||
<el-table-column prop="classes_desc" width="300" label="班型简介" :show-overflow-tooltip="true"> </el-table-column>
|
<template #classes_sort="scope">
|
||||||
<el-table-column prop="classes_sort" width="200" label="排序" sort>
|
<el-input-number :disabled="loading" v-model='scope.row.classes_sort' controls-position="right"
|
||||||
<template #default="scope">
|
@change="handleEditOrder(scope.row)"></el-input-number>
|
||||||
<el-input-number v-model='scope.row.classes_sort' controls-position="right"
|
</template>
|
||||||
@change="handleEditOrder(scope.row)"></el-input-number>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column label="操作" align="center" width="250" fixed='right'>
|
<template #chaoz="scope">
|
||||||
<template #default="scope">
|
<el-space>
|
||||||
<el-button size="small" type="primary" @click="handleUpdate(scope.row)">编辑</el-button>
|
<el-button size="small" @click="handleUpdate(scope.row)">
|
||||||
<el-button size="small" type="danger" @click="handleDelete([scope.row])">删除</el-button>
|
编辑
|
||||||
<el-button size="small" type="info" @click="handleDetail(scope.row)">查看</el-button>
|
</el-button>
|
||||||
</template>
|
<el-dropdown @command="handleCommand">
|
||||||
</el-table-column>
|
<el-button type="primary" size="small">
|
||||||
</el-table>
|
更多<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
||||||
<pagination :total="total" v-model:page="params.page" v-model:limit="params.limit"
|
</el-button>
|
||||||
@pagination="getList" />
|
<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>
|
||||||
|
|
||||||
<!-- 添加班型 -->
|
<!-- 添加班型 -->
|
||||||
<AddClassesDialog v-model="addClassesDialogVisible" :done="() => getList()"></AddClassesDialog>
|
<AddClassesDialog v-model="addClassesDialogVisible" :done="() => tableDataInit()"></AddClassesDialog>
|
||||||
<!-- 编辑班型 -->
|
<!-- 编辑班型 -->
|
||||||
<EditClassesDialog v-model="EditClassesDialogVisible" :data="EditClassesDialogRow" :done="() => getList()">
|
<EditClassesDialog v-model="EditClassesDialogVisible" :data="EditClassesDialogRow" :done="() => tableDataInit()">
|
||||||
</EditClassesDialog>
|
</EditClassesDialog>
|
||||||
<!-- 班型详情 -->
|
<!-- 班型详情 -->
|
||||||
<DetailClassesDialog v-model="DetailClassesDialogVisible" :data="DetailClassesDialogRow"></DetailClassesDialog>
|
<DetailClassesDialog v-model="DetailClassesDialogVisible" :data="DetailClassesDialogRow"></DetailClassesDialog>
|
||||||
@ -101,11 +111,6 @@ const EditClassesDialogRow = ref({});
|
|||||||
const DetailClassesDialogVisible = ref(false);
|
const DetailClassesDialogVisible = ref(false);
|
||||||
const DetailClassesDialogRow = ref({});
|
const DetailClassesDialogRow = ref({});
|
||||||
|
|
||||||
const loading = ref(false)
|
|
||||||
const dataList = ref([])
|
|
||||||
//排序
|
|
||||||
let drag = ref(false)
|
|
||||||
|
|
||||||
const headers = {
|
const headers = {
|
||||||
Accept: "application/json",
|
Accept: "application/json",
|
||||||
...store.headers,
|
...store.headers,
|
||||||
@ -113,14 +118,40 @@ const headers = {
|
|||||||
|
|
||||||
|
|
||||||
// 查询参数
|
// 查询参数
|
||||||
let total = ref()
|
|
||||||
const params = reactive({
|
const params = reactive({
|
||||||
page: 1,
|
|
||||||
limit: 10,
|
|
||||||
classes_name: "",
|
classes_name: "",
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const column = [
|
||||||
|
|
||||||
|
{
|
||||||
|
fixed: true,
|
||||||
|
type: 'selection'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "classes_name",
|
||||||
|
label: '班型名称',
|
||||||
|
width: '150'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "classes_desc",
|
||||||
|
label: '班型简介',
|
||||||
|
width: '200'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "classes_sort",
|
||||||
|
label: '排序',
|
||||||
|
width: '200'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '操作',
|
||||||
|
prop: 'chaoz',
|
||||||
|
width: '250',
|
||||||
|
fixed: 'right'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
const handleCommand = ({ type, row }) => {
|
const handleCommand = ({ type, row }) => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "detail":
|
case "detail":
|
||||||
@ -134,39 +165,38 @@ const handleCommand = ({ type, row }) => {
|
|||||||
|
|
||||||
|
|
||||||
// 查询数据
|
// 查询数据
|
||||||
function getList() {
|
//表格数据获取及拖拽处理
|
||||||
loading.value = true
|
let drag = ref(false)
|
||||||
getClassesList(params).then((res) => {
|
let tableData = ref();
|
||||||
if (res.code == 0) {
|
async function tableDataInit(params) {
|
||||||
dataList.value = res.data
|
await getClassesList(params).then((res) => tableData.value = res)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
[...document.getElementsByClassName('el-table__row')].map(item => { item.classList.add('row1') });
|
[...document.getElementsByClassName('el-table__row')].map(item => { item.classList.add('row1') });
|
||||||
[...document.getElementsByClassName('el-table__row--level-1')].map(item => { item.classList.remove('row1') })
|
drag.value === false && (drag.value = createDraw(document.getElementsByClassName('el-table__row')[0].parentElement))
|
||||||
drag.value === false && (drag.value = createDraw(document.getElementsByClassName('el-table__row')[0].parentElement))
|
|
||||||
})
|
|
||||||
total.value = res.count
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
return tableData.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(drag, () => {
|
watch(drag, () => {
|
||||||
drag.value.start(() => {
|
const orderField = 'classes_sort';
|
||||||
dataList.value.map(item => {
|
|
||||||
tableRef.value.toggleRowExpansion(item, false)
|
|
||||||
})
|
|
||||||
tableExpandAll.value = false
|
|
||||||
})
|
|
||||||
drag.value.drop((info) => {
|
drag.value.drop((info) => {
|
||||||
let targetIdx = [...document.getElementsByClassName('row1')].indexOf(info.el)
|
let targetIdx = [...document.getElementsByClassName('row1')].indexOf(info.el)
|
||||||
let sourceIdx = [...document.getElementsByClassName('row1')].indexOf(info.info.source.el)
|
let sourceIdx = [...document.getElementsByClassName('row1')].indexOf(info.info.source.el)
|
||||||
let orderIdx = dataList.value[sourceIdx]['classes_sort']
|
let orderIdx = tableData.value.data[sourceIdx][orderField]
|
||||||
dataList.value[targetIdx]['classes_sort'] = orderIdx
|
tableData.value.data[targetIdx][orderField] = orderIdx
|
||||||
handleEditOrder(dataList.value[targetIdx])
|
handleEditOrder(tableData.value.data[targetIdx])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
getList()
|
|
||||||
|
//排序
|
||||||
|
const loading = ref(false)
|
||||||
|
async function handleEditOrder(data) {
|
||||||
|
loading.value = true
|
||||||
|
const { code } = await editClasses(data);
|
||||||
|
if (code == 0) {
|
||||||
|
loading.value = false
|
||||||
|
tableRef.value.reload()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 删除数据
|
// 删除数据
|
||||||
const handleDelete = data => {
|
const handleDelete = data => {
|
||||||
@ -175,7 +205,7 @@ const handleDelete = data => {
|
|||||||
classes_guid: data.map(v => v.classes_guid).join()
|
classes_guid: data.map(v => v.classes_guid).join()
|
||||||
});
|
});
|
||||||
if (res) {
|
if (res) {
|
||||||
getList();
|
tableRef.value.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -213,16 +243,9 @@ const handleExcelSuccess = (value) => {
|
|||||||
ElMessage.error(value.msg);
|
ElMessage.error(value.msg);
|
||||||
}
|
}
|
||||||
closeUploadLoading();
|
closeUploadLoading();
|
||||||
getList();
|
tableRef.value.reload();
|
||||||
};
|
};
|
||||||
|
|
||||||
//排序
|
|
||||||
async function handleEditOrder(data) {
|
|
||||||
loading.value = true
|
|
||||||
await editClasses(data);
|
|
||||||
getList();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -0,0 +1,136 @@
|
|||||||
|
<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="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="标题" prop="enter_school_process_title">
|
||||||
|
<el-input v-model='formData.enter_school_process_title' type="text" placeholder='请输入标题'></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="介绍" prop="enter_school_process_intro">
|
||||||
|
<el-input v-model='formData.enter_school_process_intro' type="textarea" :rows="5"
|
||||||
|
placeholder='请输入介绍'></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="排序" prop="enter_school_process_sort">
|
||||||
|
<el-input-number v-model='formData.enter_school_process_sort' controls-position='right'></el-input-number>
|
||||||
|
</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 { addEnterSchoolProcess } from "~/service/enter_school_process";
|
||||||
|
import { useLoginStore } from "~/store";
|
||||||
|
|
||||||
|
// --业务参数
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// --业务方法
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// --基础参数
|
||||||
|
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({
|
||||||
|
enter_school_process_sort: 1
|
||||||
|
});
|
||||||
|
|
||||||
|
const uoloadData = ref({
|
||||||
|
dirName: "EnterSchoolProcess"
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(props, (v) => {
|
||||||
|
dialogVisible.value = v.modelValue;
|
||||||
|
});
|
||||||
|
|
||||||
|
const rules = reactive({
|
||||||
|
enter_school_process_title: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '标题不能为空'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
enter_school_process_intro: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '介绍不能为空'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
enter_school_process_sort: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '排序不能为空'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// --基础方法
|
||||||
|
|
||||||
|
// 打开弹窗时执行
|
||||||
|
const openDialog = () => {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
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 addEnterSchoolProcess(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,77 @@
|
|||||||
|
<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="enter_school_process_title">
|
||||||
|
<el-input v-model='formData.enter_school_process_title' type="text" placeholder='请输入标题'></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="介绍" prop="enter_school_process_intro">
|
||||||
|
<el-input v-model='formData.enter_school_process_intro' type="textarea" :rows="5" placeholder='请输入介绍'></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="排序" prop="enter_school_process_sort">
|
||||||
|
<el-input-number v-model='formData.enter_school_process_sort' controls-position='right'></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";
|
||||||
|
|
||||||
|
|
||||||
|
// --业务参数
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// --业务方法
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// --基础参数
|
||||||
|
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 = () => {
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
const closeDialog = () => {
|
||||||
|
emits("update:modelValue", false);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
|
||||||
|
</style>
|
@ -0,0 +1,133 @@
|
|||||||
|
<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="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="标题" prop="enter_school_process_title">
|
||||||
|
<el-input v-model='formData.enter_school_process_title' type="text" placeholder='请输入标题'></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="介绍" prop="enter_school_process_intro">
|
||||||
|
<el-input v-model='formData.enter_school_process_intro' type="textarea" :rows="5" placeholder='请输入介绍'></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="排序" prop="enter_school_process_sort">
|
||||||
|
<el-input-number v-model='formData.enter_school_process_sort' controls-position='right'></el-input-number>
|
||||||
|
</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 { editEnterSchoolProcess } from "~/service/enter_school_process";
|
||||||
|
import { useLoginStore } from "~/store";
|
||||||
|
|
||||||
|
// --业务参数
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// --业务方法
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// --基础参数
|
||||||
|
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: "EnterSchoolProcess"
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
// --基础方法
|
||||||
|
watch(props, (v) => {
|
||||||
|
formData.value = v.data;
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 打开弹窗时执行
|
||||||
|
const openDialog = () => {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
const closeDialog = () => {
|
||||||
|
props.done();
|
||||||
|
emits("update:modelValue", false);
|
||||||
|
};
|
||||||
|
|
||||||
|
const rules = reactive({
|
||||||
|
enter_school_process_title: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '标题不能为空'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
enter_school_process_intro: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '介绍不能为空'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
enter_school_process_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 editEnterSchoolProcess(formData.value);
|
||||||
|
if (code == 0) {
|
||||||
|
closeDialog();
|
||||||
|
props.done();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const handleResetClick = async (formEl) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.resetFields();
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
|
||||||
|
</style>
|
221
src/pages/index/enrol/enter_school_process/index.vue
Normal file
221
src/pages/index/enrol/enter_school_process/index.vue
Normal file
@ -0,0 +1,221 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 面包屑 -->
|
||||||
|
<el-breadcrumb>
|
||||||
|
<el-breadcrumb-item>入学流程管理</el-breadcrumb-item>
|
||||||
|
<el-breadcrumb-item to="/enter_school_process/list">入学流程列表</el-breadcrumb-item>
|
||||||
|
</el-breadcrumb>
|
||||||
|
<!-- 搜索 -->
|
||||||
|
<el-form inline :model="params">
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="标题">
|
||||||
|
<el-input v-model='params.enter_school_process_title' placeholder='请输入标题'></el-input>
|
||||||
|
</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="addEnterSchoolProcessDialogVisible = 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 => tableDataInit(params)">
|
||||||
|
|
||||||
|
<!-- 排序 -->
|
||||||
|
<template #enter_school_process_sort="scope">
|
||||||
|
<el-input-number :disabled="loading" v-model='scope.row.enter_school_process_sort' controls-position="right"
|
||||||
|
@change="handleEditOrder(scope.row)"></el-input-number>
|
||||||
|
</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>
|
||||||
|
|
||||||
|
<!-- 添加入学流程 -->
|
||||||
|
<AddEnterSchoolProcessDialog v-model="addEnterSchoolProcessDialogVisible" :done="() => tableRef.reload()">
|
||||||
|
</AddEnterSchoolProcessDialog>
|
||||||
|
<!-- 编辑入学流程 -->
|
||||||
|
<EditEnterSchoolProcessDialog v-model="EditEnterSchoolProcessDialogVisible" :data="EditEnterSchoolProcessDialogRow"
|
||||||
|
:done="() => tableRef.reload()"></EditEnterSchoolProcessDialog>
|
||||||
|
<!-- 入学流程详情 -->
|
||||||
|
<DetailEnterSchoolProcessDialog v-model="DetailEnterSchoolProcessDialogVisible"
|
||||||
|
:data="DetailEnterSchoolProcessDialogRow"></DetailEnterSchoolProcessDialog>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { ArrowDown } from '@element-plus/icons-vue';
|
||||||
|
import { ref, reactive, watch } from 'vue';
|
||||||
|
import { useLoginStore } from "~/store";
|
||||||
|
import { getEnterSchoolProcessList,editEnterSchoolProcess, deleteEnterSchoolProcess, exportExcel } from '~/service/enter_school_process';
|
||||||
|
import AddEnterSchoolProcessDialog from './components/AddEnterSchoolProcessDialog.vue';
|
||||||
|
import EditEnterSchoolProcessDialog from './components/EditEnterSchoolProcessDialog.vue';
|
||||||
|
import DetailEnterSchoolProcessDialog from './components/DetailEnterSchoolProcessDialog.vue';
|
||||||
|
import createDraw from 'hyw-drag'
|
||||||
|
|
||||||
|
const tableRef = ref();
|
||||||
|
const selectionData = ref([]);
|
||||||
|
const store = useLoginStore();
|
||||||
|
|
||||||
|
const addEnterSchoolProcessDialogVisible = ref(false);
|
||||||
|
const EditEnterSchoolProcessDialogVisible = ref(false);
|
||||||
|
const EditEnterSchoolProcessDialogRow = ref({});
|
||||||
|
const DetailEnterSchoolProcessDialogVisible = ref(false);
|
||||||
|
const DetailEnterSchoolProcessDialogRow = ref({});
|
||||||
|
|
||||||
|
const headers = {
|
||||||
|
Accept: "application/json",
|
||||||
|
...store.headers,
|
||||||
|
};
|
||||||
|
|
||||||
|
// 查询参数
|
||||||
|
const params = reactive({
|
||||||
|
enter_school_process_title: "",
|
||||||
|
|
||||||
|
});
|
||||||
|
const column = [
|
||||||
|
|
||||||
|
{
|
||||||
|
fixed: true,
|
||||||
|
type: 'selection'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "enter_school_process_title",
|
||||||
|
label: '标题',
|
||||||
|
width: '150'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "enter_school_process_intro",
|
||||||
|
label: '介绍',
|
||||||
|
width: '250'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "enter_school_process_sort",
|
||||||
|
label: '排序',
|
||||||
|
width: '150'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '操作',
|
||||||
|
prop: 'chaoz',
|
||||||
|
width: '250',
|
||||||
|
fixed: 'right'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
//表格数据获取及拖拽处理
|
||||||
|
let drag = ref(false)
|
||||||
|
let tableData = ref();
|
||||||
|
async function tableDataInit(params) {
|
||||||
|
await getEnterSchoolProcessList(params).then((res) => tableData.value = res)
|
||||||
|
setTimeout(() => {
|
||||||
|
[...document.getElementsByClassName('el-table__row')].map(item => { item.classList.add('row1') });
|
||||||
|
drag.value === false && (drag.value = createDraw(document.getElementsByClassName('el-table__row')[0].parentElement))
|
||||||
|
})
|
||||||
|
return tableData.value;
|
||||||
|
}
|
||||||
|
watch(drag, () => {
|
||||||
|
const orderField = 'enter_school_process_sort';
|
||||||
|
drag.value.drop((info) => {
|
||||||
|
let targetIdx = [...document.getElementsByClassName('row1')].indexOf(info.el)
|
||||||
|
let sourceIdx = [...document.getElementsByClassName('row1')].indexOf(info.info.source.el)
|
||||||
|
let orderIdx = tableData.value.data[sourceIdx][orderField]
|
||||||
|
tableData.value.data[targetIdx][orderField] = orderIdx
|
||||||
|
handleEditOrder(tableData.value.data[targetIdx])
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
//排序
|
||||||
|
const loading = ref(false)
|
||||||
|
async function handleEditOrder(data) {
|
||||||
|
loading.value = true
|
||||||
|
const { code } = await editEnterSchoolProcess(data);
|
||||||
|
if (code == 0) {
|
||||||
|
loading.value = false
|
||||||
|
tableRef.value.reload()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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 deleteEnterSchoolProcess({
|
||||||
|
enter_school_process_guid: data.map(v => v.enter_school_process_guid).join()
|
||||||
|
});
|
||||||
|
if (res) {
|
||||||
|
tableRef.value.reload();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
function handleUpdate(row) {
|
||||||
|
EditEnterSchoolProcessDialogVisible.value = true
|
||||||
|
EditEnterSchoolProcessDialogRow.value = row
|
||||||
|
}
|
||||||
|
|
||||||
|
// 详情
|
||||||
|
function handleDetail(row) {
|
||||||
|
DetailEnterSchoolProcessDialogVisible.value = true
|
||||||
|
DetailEnterSchoolProcessDialogRow.value = row
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
@ -2,30 +2,30 @@
|
|||||||
<el-dialog v-model="dialogVisible" title="添加报名流程" width="900px" @closed="closeDialog" @open="openDialog">
|
<el-dialog v-model="dialogVisible" title="添加报名流程" width="900px" @closed="closeDialog" @open="openDialog">
|
||||||
<el-form ref="formRef" :model="formData" :rules="rules">
|
<el-form ref="formRef" :model="formData" :rules="rules">
|
||||||
<el-row>
|
<el-row>
|
||||||
|
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item :label-width="labelWidth" label="标题" prop="sign_up_process_title">
|
<el-form-item :label-width="labelWidth" label="标题" prop="sign_up_process_title">
|
||||||
<el-input v-model='formData.sign_up_process_title' type="text" placeholder='请输入标题'></el-input>
|
<el-input v-model='formData.sign_up_process_title' type="text" placeholder='请输入标题'></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span='12'>
|
<el-col :span='12'>
|
||||||
<el-form-item :label-width='labelWidth' label='图标' prop='sign_up_process_icon'>
|
<el-form-item :label-width='labelWidth' label='图标' prop='sign_up_process_icon'>
|
||||||
<UploadImage ref='uploadRef' v-model='formData.sign_up_process_icon' :data=uoloadData :limit='1' :fileSize='5'
|
<UploadImage ref='uploadRef' v-model='formData.sign_up_process_icon' :data=uoloadData :limit='1' :fileSize='5'
|
||||||
:drag='true' :isShowTip='false' />
|
:drag='true' :isShowTip='false' />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item :label-width="labelWidth" label="介绍" prop="sign_up_process_intro">
|
<el-form-item :label-width="labelWidth" label="介绍" prop="sign_up_process_intro">
|
||||||
<el-input v-model='formData.sign_up_process_intro' type="textarea" :rows="5" placeholder='请输入介绍'></el-input>
|
<el-input v-model='formData.sign_up_process_intro' type="textarea" :rows="5" placeholder='请输入介绍'></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item :label-width="labelWidth" label="排序" prop="sign_up_process_sort">
|
<el-form-item :label-width="labelWidth" label="排序" prop="sign_up_process_sort">
|
||||||
<el-input-number v-model='formData.sign_up_process_sort' controls-position='right'></el-input-number>
|
<el-input-number v-model='formData.sign_up_process_sort' controls-position='right'></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, ref, watch } from "vue";
|
import { reactive, ref, watch } from "vue";
|
||||||
import { addSignUpProcess } from "~/service/sign_up_process";
|
import { addSignUpProcess } from "~/service/sign_up_process";
|
||||||
import { useLoginStore } from "~/store";
|
import { useLoginStore } from "~/store";
|
||||||
|
|
||||||
// --业务参数
|
// --业务参数
|
||||||
@ -69,7 +69,9 @@ const props = defineProps({
|
|||||||
});
|
});
|
||||||
const emits = defineEmits(["update:modelValue"]);
|
const emits = defineEmits(["update:modelValue"]);
|
||||||
const dialogVisible = ref(props.modelValue);
|
const dialogVisible = ref(props.modelValue);
|
||||||
const formData = reactive({});
|
const formData = reactive({
|
||||||
|
sign_up_process_sort: 1
|
||||||
|
});
|
||||||
|
|
||||||
const uoloadData = ref({
|
const uoloadData = ref({
|
||||||
dirName: "SignUpProcess"
|
dirName: "SignUpProcess"
|
||||||
@ -81,30 +83,30 @@ watch(props, (v) => {
|
|||||||
|
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
sign_up_process_title: [
|
sign_up_process_title: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '标题不能为空'
|
message: '标题不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
sign_up_process_icon: [
|
sign_up_process_icon: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '图标不能为空'
|
message: '图标不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
sign_up_process_intro: [
|
sign_up_process_intro: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '介绍不能为空'
|
message: '介绍不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
sign_up_process_sort: [
|
sign_up_process_sort: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '排序不能为空'
|
message: '排序不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -112,7 +114,7 @@ const rules = reactive({
|
|||||||
|
|
||||||
// 打开弹窗时执行
|
// 打开弹窗时执行
|
||||||
const openDialog = () => {
|
const openDialog = () => {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
@ -128,7 +130,7 @@ const handleAddClick = async (formEl) => {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { code } = await addSignUpProcess(formData);
|
const { code } = await addSignUpProcess(formData);
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
closeDialog();
|
closeDialog();
|
||||||
@ -143,6 +145,4 @@ const handleResetClick = async (formEl) => {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped></style>
|
||||||
|
|
||||||
</style>
|
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
|
|
||||||
<el-form-item label="标题">
|
<el-form-item label="标题">
|
||||||
<el-input v-model='params.sign_up_process_title' placeholder='请输入标题' @keyup.enter.native="getList()"></el-input>
|
<el-input v-model='params.sign_up_process_title' placeholder='请输入标题' @keyup.enter.native="tableDataInit()"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="getList()" icon="ElIconSearch">
|
<el-button type="primary" @click="tableDataInit()" icon="ElIconSearch">
|
||||||
搜索
|
搜索
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -41,42 +41,52 @@
|
|||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</el-space>
|
</el-space>
|
||||||
<!-- 数据表格 -->
|
<!-- 数据表格 -->
|
||||||
<el-table v-loading="loading" :data="dataList" ref="tableRef" border highlight-current-row
|
<DataTable ref="tableRef" style="width: 100%" v-loading="loading"
|
||||||
:onSelectionChange="data => (selectionData = data)">
|
:onSelectionChange="data => (selectionData = data)" :column="column" :params="params"
|
||||||
<el-table-column type="selection" width="50" align="center" />
|
:request="params => tableDataInit(params)">
|
||||||
<el-table-column prop="sign_up_process_title" width="250" label="标题" :show-overflow-tooltip="true"> </el-table-column>
|
<!-- 排序 -->
|
||||||
<el-table-column prop="sign_up_process_intro" width="300" label="介绍" :show-overflow-tooltip="true"> </el-table-column>
|
<template #sign_up_process_sort="scope">
|
||||||
<el-table-column prop="sign_up_process_icon" width="200" label="图标" :show-overflow-tooltip="true" align="center">
|
<el-input-number :disabled="loading" v-model='scope.row.sign_up_process_sort' controls-position="right"
|
||||||
<template #default="scope">
|
@change="handleEditOrder(scope.row)"></el-input-number>
|
||||||
|
</template>
|
||||||
|
<!-- icon -->
|
||||||
|
<template #sign_up_process_icon="scope">
|
||||||
<el-image v-if="scope.row.sign_up_process_icon" :src="scope.row.sign_up_process_icon.split(',')[0]" lazy
|
<el-image v-if="scope.row.sign_up_process_icon" :src="scope.row.sign_up_process_icon.split(',')[0]" lazy
|
||||||
:preview-src-list="scope.row.sign_up_process_icon.split(',')" :preview-teleported="true"
|
:preview-src-list="scope.row.sign_up_process_icon.split(',')" :preview-teleported="true"
|
||||||
:hide-on-click-modal="true" fit="contain" class="el-avatar"></el-image>
|
:hide-on-click-modal="true" fit="contain" class="el-avatar"></el-image>
|
||||||
<template v-else>暂无图片</template>
|
<template v-else>暂无图片</template>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="sign_up_process_sort" width="200" label="排序" sort>
|
|
||||||
<template #default="scope">
|
|
||||||
<el-input-number v-model='scope.row.sign_up_process_sort' controls-position="right"
|
|
||||||
@change="handleEditOrder(scope.row)"></el-input-number>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column label="操作" align="center" width="250" fixed='right'>
|
<template #chaoz="scope">
|
||||||
<template #default="scope">
|
<el-space>
|
||||||
<el-button size="small" type="primary" @click="handleUpdate(scope.row)">编辑</el-button>
|
<el-button size="small" @click="handleUpdate(scope.row)">
|
||||||
<el-button size="small" type="danger" @click="handleDelete([scope.row])">删除</el-button>
|
编辑
|
||||||
<el-button size="small" type="info" @click="handleDetail(scope.row)">查看</el-button>
|
</el-button>
|
||||||
</template>
|
<el-dropdown @command="handleCommand">
|
||||||
</el-table-column>
|
<el-button type="primary" size="small">
|
||||||
</el-table>
|
更多<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
||||||
<pagination :total="total" v-model:page="params.page" v-model:limit="params.limit" @pagination="getList" />
|
</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>
|
||||||
|
|
||||||
<!-- 添加报名流程 -->
|
<!-- 添加报名流程 -->
|
||||||
<AddSignUpProcessDialog v-model="addSignUpProcessDialogVisible" :done="() => getList()">
|
<AddSignUpProcessDialog v-model="addSignUpProcessDialogVisible" :done="() => tableDataInit()">
|
||||||
</AddSignUpProcessDialog>
|
</AddSignUpProcessDialog>
|
||||||
<!-- 编辑报名流程 -->
|
<!-- 编辑报名流程 -->
|
||||||
<EditSignUpProcessDialog v-model="EditSignUpProcessDialogVisible" :data="EditSignUpProcessDialogRow"
|
<EditSignUpProcessDialog v-model="EditSignUpProcessDialogVisible" :data="EditSignUpProcessDialogRow"
|
||||||
:done="() => getList()"></EditSignUpProcessDialog>
|
:done="() => tableDataInit()"></EditSignUpProcessDialog>
|
||||||
<!-- 报名流程详情 -->
|
<!-- 报名流程详情 -->
|
||||||
<DetailSignUpProcessDialog v-model="DetailSignUpProcessDialogVisible" :data="DetailSignUpProcessDialogRow">
|
<DetailSignUpProcessDialog v-model="DetailSignUpProcessDialogVisible" :data="DetailSignUpProcessDialogRow">
|
||||||
</DetailSignUpProcessDialog>
|
</DetailSignUpProcessDialog>
|
||||||
@ -106,71 +116,78 @@ const headers = {
|
|||||||
...store.headers,
|
...store.headers,
|
||||||
};
|
};
|
||||||
|
|
||||||
const loading = ref(false)
|
|
||||||
const dataList = ref([])
|
|
||||||
//排序
|
|
||||||
let drag = ref(false)
|
|
||||||
// 查询参数
|
// 查询参数
|
||||||
let total = ref()
|
|
||||||
const params = reactive({
|
const params = reactive({
|
||||||
page: 1,
|
|
||||||
limit: 10,
|
|
||||||
sign_up_process_title: "",
|
sign_up_process_title: "",
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleCommand = ({ type, row }) => {
|
const column = [
|
||||||
switch (type) {
|
|
||||||
case "detail":
|
|
||||||
handleDetail(row);
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
handleDelete([row]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
{
|
||||||
|
fixed: true,
|
||||||
|
type: 'selection'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "sign_up_process_title",
|
||||||
|
label: '标题',
|
||||||
|
width: '150'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "sign_up_process_intro",
|
||||||
|
label: '介绍',
|
||||||
|
width: '200'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "sign_up_process_icon",
|
||||||
|
label: '图标',
|
||||||
|
width: '200'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "sign_up_process_sort",
|
||||||
|
label: '排序',
|
||||||
|
width: '200'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '操作',
|
||||||
|
prop: 'chaoz',
|
||||||
|
width: '250',
|
||||||
|
fixed: 'right'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
// 查询数据
|
// 查询数据
|
||||||
function getList() {
|
//表格数据获取及拖拽处理
|
||||||
loading.value = true
|
let drag = ref(false)
|
||||||
getSignUpProcessList(params).then((res) => {
|
let tableData = ref();
|
||||||
if (res.code == 0) {
|
async function tableDataInit(params) {
|
||||||
dataList.value = res.data
|
await getSignUpProcessList(params).then((res) => tableData.value = res)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
[...document.getElementsByClassName('el-table__row')].map(item => { item.classList.add('row1') });
|
[...document.getElementsByClasstitle('el-table__row')].map(item => { item.classList.add('row1') });
|
||||||
[...document.getElementsByClassName('el-table__row--level-1')].map(item => { item.classList.remove('row1') })
|
drag.value === false && (drag.value = createDraw(document.getElementsByClasstitle('el-table__row')[0].parentElement))
|
||||||
drag.value === false && (drag.value = createDraw(document.getElementsByClassName('el-table__row')[0].parentElement))
|
|
||||||
})
|
|
||||||
total.value = res.count
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
return tableData.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(drag, () => {
|
watch(drag, () => {
|
||||||
drag.value.start(() => {
|
const orderField = 'sign_up_process_sort';
|
||||||
dataList.value.map(item => {
|
|
||||||
tableRef.value.toggleRowExpansion(item, false)
|
|
||||||
})
|
|
||||||
tableExpandAll.value = false
|
|
||||||
})
|
|
||||||
drag.value.drop((info) => {
|
drag.value.drop((info) => {
|
||||||
let targetIdx = [...document.getElementsByClassName('row1')].indexOf(info.el)
|
let targetIdx = [...document.getElementsByClasstitle('row1')].indexOf(info.el)
|
||||||
let sourceIdx = [...document.getElementsByClassName('row1')].indexOf(info.info.source.el)
|
let sourceIdx = [...document.getElementsByClasstitle('row1')].indexOf(info.info.source.el)
|
||||||
let orderIdx = dataList.value[sourceIdx]['sign_up_process_sort']
|
let orderIdx = tableData.value.data[sourceIdx][orderField]
|
||||||
dataList.value[targetIdx]['sign_up_process_sort'] = orderIdx
|
tableData.value.data[targetIdx][orderField] = orderIdx
|
||||||
handleEditOrder(dataList.value[targetIdx])
|
handleEditOrder(tableData.value.data[targetIdx])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
getList()
|
|
||||||
|
|
||||||
//排序
|
//排序
|
||||||
|
const loading = ref(false)
|
||||||
async function handleEditOrder(data) {
|
async function handleEditOrder(data) {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
await editSignUpProcess(data);
|
const { code } = await editSignUpProcess(data);
|
||||||
getList();
|
if (code == 0) {
|
||||||
|
loading.value = false
|
||||||
|
tableRef.value.reload()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -181,11 +198,22 @@ const handleDelete = data => {
|
|||||||
sign_up_process_guid: data.map(v => v.sign_up_process_guid).join()
|
sign_up_process_guid: data.map(v => v.sign_up_process_guid).join()
|
||||||
});
|
});
|
||||||
if (res) {
|
if (res) {
|
||||||
getList();
|
tableDataInit();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleCommand = ({ type, row }) => {
|
||||||
|
switch (type) {
|
||||||
|
case "detail":
|
||||||
|
handleDetail(row);
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
handleDelete([row]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// 修改
|
// 修改
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
EditSignUpProcessDialogVisible.value = true
|
EditSignUpProcessDialogVisible.value = true
|
||||||
|
65
src/service/enter_school_process.js
Normal file
65
src/service/enter_school_process.js
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
import { api, downloadFile, createApiUrl } from '~/utils/axios';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出入学流程
|
||||||
|
* @param {Object} data
|
||||||
|
* @return {Promise} api
|
||||||
|
*/
|
||||||
|
export function exportExcel(data) {
|
||||||
|
downloadFile(createApiUrl('Enrol.EnterSchoolProcess/exportExcel'), data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取入学流程列表
|
||||||
|
* @param {Object} data
|
||||||
|
* @return {Promise} api
|
||||||
|
*/
|
||||||
|
export function getEnterSchoolProcessList(data) {
|
||||||
|
return api.post('Enrol.EnterSchoolProcess/getEnterSchoolProcessList', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除入学流程
|
||||||
|
* @param {Object} data
|
||||||
|
* @return {Promise} api
|
||||||
|
*/
|
||||||
|
export function deleteEnterSchoolProcess(data) {
|
||||||
|
return api.post('Enrol.EnterSchoolProcess/deleteEnterSchoolProcess', data, {
|
||||||
|
isTransformResponse: true,
|
||||||
|
isShowSuccessMessage: true,
|
||||||
|
errorMessageText: '删除失败'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加入学流程
|
||||||
|
* @param {Object} data
|
||||||
|
* @return {Promise} api
|
||||||
|
*/
|
||||||
|
export function addEnterSchoolProcess(data) {
|
||||||
|
return api.post('Enrol.EnterSchoolProcess/addEnterSchoolProcess', data, {
|
||||||
|
isTransformResponse: true,
|
||||||
|
isShowSuccessMessage: true,
|
||||||
|
errorMessageText: '添加失败'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 编辑入学流程
|
||||||
|
* @param {Object} data
|
||||||
|
* @return {Promise} api
|
||||||
|
*/
|
||||||
|
export function editEnterSchoolProcess(data) {
|
||||||
|
return api.post('Enrol.EnterSchoolProcess/editEnterSchoolProcess', data, {
|
||||||
|
isTransformResponse: true,
|
||||||
|
isShowSuccessMessage: true,
|
||||||
|
errorMessageText: '编辑失败'
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user