fix: 修改排序
This commit is contained in:
parent
40b4904b4a
commit
ea49f784ba
@ -81,7 +81,6 @@ 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({
|
||||||
company_profile_order: 0
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const uoloadData = ref({
|
const uoloadData = ref({
|
||||||
@ -105,12 +104,6 @@ const rules = reactive({
|
|||||||
message: '简介内容不能为空'
|
message: '简介内容不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
company_profile_order: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '简介排序不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
company_profile_color: [
|
company_profile_color: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -78,7 +78,6 @@ 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({
|
||||||
teaching_envir_type_order: 0,
|
|
||||||
teaching_envir_type_parent_guid: '0',
|
teaching_envir_type_parent_guid: '0',
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -97,12 +96,7 @@ const rules = reactive({
|
|||||||
message: '环境类型名称不能为空'
|
message: '环境类型名称不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
teaching_envir_type_order: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '环境类型排序不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -75,7 +75,6 @@ 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({
|
||||||
banner_order: 1
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const uoloadData = ref({
|
const uoloadData = ref({
|
||||||
@ -99,12 +98,7 @@ const rules = reactive({
|
|||||||
// message: '轮播图片位置(字典)不能为空'
|
// message: '轮播图片位置(字典)不能为空'
|
||||||
// }
|
// }
|
||||||
// ],
|
// ],
|
||||||
banner_order: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '排序不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -179,7 +179,6 @@ async function handleEditOrder(data) {
|
|||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
tableRef.value.reload()
|
tableRef.value.reload()
|
||||||
ElMessage.success(msg);
|
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(msg);
|
ElMessage.error(msg);
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ 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({
|
||||||
poster_sort: 1
|
// poster_sort: 1
|
||||||
});
|
});
|
||||||
|
|
||||||
const uoloadData = ref({
|
const uoloadData = ref({
|
||||||
@ -121,12 +121,6 @@ const rules = reactive({
|
|||||||
message: '描述不能为空'
|
message: '描述不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
poster_sort: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '排序不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -68,7 +68,6 @@ 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({
|
||||||
contact_scancode_order: 1
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const uoloadData = ref({
|
const uoloadData = ref({
|
||||||
|
@ -15,6 +15,17 @@
|
|||||||
:drag='true' :isShowTip='false' />
|
:drag='true' :isShowTip='false' />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="排序" prop="classes_sort">
|
||||||
|
<el-input-number v-model='formData.classes_sort' controls-position='right'></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span='12'>
|
||||||
|
<el-form-item :label-width='labelWidth + 10' label='首页是否展示' prop='classes_status'>
|
||||||
|
<el-switch v-model='formData.classes_status' class='mt-2' inline-prompt :inactive-value=1 :active-value=2
|
||||||
|
style='--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949' />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item :label-width="labelWidth" label="简介" prop="classes_desc">
|
<el-form-item :label-width="labelWidth" label="简介" prop="classes_desc">
|
||||||
<el-input v-model='formData.classes_desc' type="textarea" :rows="5" placeholder='请输入简介'></el-input>
|
<el-input v-model='formData.classes_desc' type="textarea" :rows="5" placeholder='请输入简介'></el-input>
|
||||||
@ -25,27 +36,6 @@
|
|||||||
<RichText v-model='formData.classes_content' :min-height='196'></RichText>
|
<RichText v-model='formData.classes_content' :min-height='196'></RichText>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item :label-width="labelWidth" label="排序" prop="classes_sort">
|
|
||||||
<el-input-number v-model='formData.classes_sort' controls-position='right'></el-input-number>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="首页是否展示" prop="classes_status">
|
|
||||||
<el-select
|
|
||||||
v-model="formData.classes_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-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -61,7 +51,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, ref, watch } from "vue";
|
import { reactive, ref, watch } from "vue";
|
||||||
import { addClasses,getDictionary } from "~/service/classes";
|
import { addClasses, getDictionary } from "~/service/classes";
|
||||||
import { useLoginStore } from "~/store";
|
import { useLoginStore } from "~/store";
|
||||||
|
|
||||||
// --业务参数
|
// --业务参数
|
||||||
@ -90,7 +80,7 @@ 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({
|
||||||
classes_sort: 1
|
classes_status: 1
|
||||||
});
|
});
|
||||||
|
|
||||||
const uoloadData = ref({
|
const uoloadData = ref({
|
||||||
@ -114,12 +104,7 @@ const rules = reactive({
|
|||||||
message: '封面不能为空'
|
message: '封面不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
classes_sort: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '排序不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -156,12 +156,7 @@ const rules = reactive({
|
|||||||
message: '答案不能为空'
|
message: '答案不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
enrol_aq_sort: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '排序不能为空'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// --基础方法
|
// --基础方法
|
||||||
|
@ -64,7 +64,6 @@ 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({
|
||||||
enter_school_process_sort: 1
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const uoloadData = ref({
|
const uoloadData = ref({
|
||||||
@ -88,12 +87,6 @@ const rules = reactive({
|
|||||||
message: '介绍不能为空'
|
message: '介绍不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
enter_school_process_sort: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '排序不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -70,7 +70,6 @@ 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({
|
||||||
@ -100,13 +99,7 @@ const rules = reactive({
|
|||||||
message: '介绍不能为空'
|
message: '介绍不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
sign_up_process_sort: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '排序不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,6 +21,11 @@
|
|||||||
<el-input v-model="formData.info_article_title" type="text" placeholder="请输入文章标题"></el-input>
|
<el-input v-model="formData.info_article_title" type="text" placeholder="请输入文章标题"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="跳转链接" prop="info_article_link">
|
||||||
|
<el-input v-model="formData.info_article_link" type="text" placeholder="请输入跳转链接"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item :label-width="labelWidth" label="文章封面" prop="info_article_cover">
|
<el-form-item :label-width="labelWidth" label="文章封面" prop="info_article_cover">
|
||||||
<UploadImage ref="uploadRef" v-model="formData.info_article_cover" :data="uoloadData" :limit="1" :fileSize="5"
|
<UploadImage ref="uploadRef" v-model="formData.info_article_cover" :data="uoloadData" :limit="1" :fileSize="5"
|
||||||
@ -92,7 +97,6 @@ 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({
|
||||||
info_article_order: 1,
|
|
||||||
info_article_cover: ""
|
info_article_cover: ""
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -117,18 +121,13 @@ const rules = reactive({
|
|||||||
message: '文章封面不能为空'
|
message: '文章封面不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
info_article_content: [
|
// info_article_content: [
|
||||||
{
|
// {
|
||||||
required: true,
|
// required: true,
|
||||||
message: '文章内容不能为空'
|
// message: '文章内容不能为空'
|
||||||
}
|
// }
|
||||||
],
|
// ],
|
||||||
info_article_order: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '文章排序不能为空'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// --基础方法
|
// --基础方法
|
||||||
|
@ -19,6 +19,11 @@
|
|||||||
<el-input v-model="formData.info_article_title" type="text" placeholder="请输入文章标题"></el-input>
|
<el-input v-model="formData.info_article_title" type="text" placeholder="请输入文章标题"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="跳转链接" prop="info_article_link">
|
||||||
|
<el-input v-model="formData.info_article_link" type="text" placeholder="请输入跳转链接"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item :label-width="labelWidth" label="文章封面" prop="info_article_cover">
|
<el-form-item :label-width="labelWidth" label="文章封面" prop="info_article_cover">
|
||||||
<UploadImage ref="uploadRef" v-model="formData.info_article_cover" :data="uoloadData" :limit="1" :fileSize="5"
|
<UploadImage ref="uploadRef" v-model="formData.info_article_cover" :data="uoloadData" :limit="1" :fileSize="5"
|
||||||
|
@ -1,33 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog
|
<el-dialog v-model="props.modelValue" title="编辑资讯文章" width="900px" @closed="closeDialog" @open="openDialog">
|
||||||
v-model="props.modelValue"
|
|
||||||
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="24">
|
<el-col :span="24">
|
||||||
<el-form-item
|
<el-form-item :label-width="labelWidth" label="文章类型" prop="info_article_type_guid">
|
||||||
:label-width="labelWidth"
|
<el-cascader class="w100" filterable :options="dataList" :props="{
|
||||||
label="文章类型"
|
checkStrictly: false,
|
||||||
prop="info_article_type_guid"
|
value: 'info_article_type_guid',
|
||||||
>
|
label: 'info_article_type_name',
|
||||||
<el-cascader
|
emitPath: false
|
||||||
class="w100"
|
}" placeholder="请选择文章类型" clearable v-model="formData.info_article_type_guid">
|
||||||
filterable
|
|
||||||
:options="dataList"
|
|
||||||
:props="{
|
|
||||||
checkStrictly: false,
|
|
||||||
value: 'info_article_type_guid',
|
|
||||||
label: 'info_article_type_name',
|
|
||||||
emitPath: false
|
|
||||||
}"
|
|
||||||
placeholder="请选择文章类型"
|
|
||||||
clearable
|
|
||||||
v-model="formData.info_article_type_guid"
|
|
||||||
>
|
|
||||||
<template #default="{ node, data }">
|
<template #default="{ node, data }">
|
||||||
<span>{{ data.info_article_type_name }}</span>
|
<span>{{ data.info_article_type_name }}</span>
|
||||||
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
|
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
|
||||||
@ -36,58 +18,30 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item
|
<el-form-item :label-width="labelWidth" label="文章标题" prop="info_article_title">
|
||||||
:label-width="labelWidth"
|
<el-input v-model="formData.info_article_title" type="text" placeholder="请输入文章标题"></el-input>
|
||||||
label="文章标题"
|
|
||||||
prop="info_article_title"
|
|
||||||
>
|
|
||||||
<el-input
|
|
||||||
v-model="formData.info_article_title"
|
|
||||||
type="text"
|
|
||||||
placeholder="请输入文章标题"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item
|
<el-form-item :label-width="labelWidth" label="跳转链接" prop="info_article_link">
|
||||||
:label-width="labelWidth"
|
<el-input v-model="formData.info_article_link" type="text" placeholder="请输入跳转链接"></el-input>
|
||||||
label="文章封面"
|
</el-form-item>
|
||||||
prop="info_article_cover"
|
</el-col>
|
||||||
>
|
<el-col :span="24">
|
||||||
<UploadImage
|
<el-form-item :label-width="labelWidth" label="文章封面" prop="info_article_cover">
|
||||||
ref="uploadRef"
|
<UploadImage ref="uploadRef" v-model="formData.info_article_cover" :data="uoloadData" :limit="1" :fileSize="5"
|
||||||
v-model="formData.info_article_cover"
|
:drag="true" :isShowTip="false" />
|
||||||
:data="uoloadData"
|
|
||||||
:limit="1"
|
|
||||||
:fileSize="5"
|
|
||||||
: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
|
<el-form-item :label-width="labelWidth" label="文章内容" prop="info_article_content">
|
||||||
:label-width="labelWidth"
|
<RichText v-model="formData.info_article_content" :min-height="196"></RichText>
|
||||||
label="文章内容"
|
|
||||||
prop="info_article_content"
|
|
||||||
>
|
|
||||||
<RichText
|
|
||||||
v-model="formData.info_article_content"
|
|
||||||
:min-height="196"
|
|
||||||
></RichText>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item
|
<el-form-item :label-width="labelWidth" label="文章排序" prop="info_article_order">
|
||||||
:label-width="labelWidth"
|
<el-input-number v-model="formData.info_article_order" controls-position="right"></el-input-number>
|
||||||
label="文章排序"
|
|
||||||
prop="info_article_order"
|
|
||||||
>
|
|
||||||
<el-input-number
|
|
||||||
v-model="formData.info_article_order"
|
|
||||||
controls-position="right"
|
|
||||||
></el-input-number>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span='12'>
|
<el-col :span='12'>
|
||||||
@ -100,9 +54,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button type="primary" @click="handleEditClick(formRef)"
|
<el-button type="primary" @click="handleEditClick(formRef)">编辑</el-button>
|
||||||
>编辑</el-button
|
|
||||||
>
|
|
||||||
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
@ -111,7 +63,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, ref, watch } from 'vue';
|
import { reactive, ref, watch } from 'vue';
|
||||||
import { editinfoArticle,getDictionary } from '~/service/info_article';
|
import { editinfoArticle, getDictionary } from '~/service/info_article';
|
||||||
import { useLoginStore } from '~/store';
|
import { useLoginStore } from '~/store';
|
||||||
import { getinfoArticleTypeList } from '~/service/info_article_type';
|
import { getinfoArticleTypeList } from '~/service/info_article_type';
|
||||||
|
|
||||||
@ -177,12 +129,12 @@ const rules = reactive({
|
|||||||
message: '文章封面不能为空'
|
message: '文章封面不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
info_article_content: [
|
// info_article_content: [
|
||||||
{
|
// {
|
||||||
required: true,
|
// required: true,
|
||||||
message: '文章内容不能为空'
|
// message: '文章内容不能为空'
|
||||||
}
|
// }
|
||||||
],
|
// ],
|
||||||
info_article_order: [
|
info_article_order: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -210,7 +210,7 @@ const column = [
|
|||||||
{
|
{
|
||||||
prop: 'info_article_title',
|
prop: 'info_article_title',
|
||||||
label: '文章标题',
|
label: '文章标题',
|
||||||
width: '250',
|
width: '300',
|
||||||
showOverflowTooltip: true,
|
showOverflowTooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -221,13 +221,18 @@ const column = [
|
|||||||
{
|
{
|
||||||
prop: "info_article_status",
|
prop: "info_article_status",
|
||||||
label: '首页是否展示',
|
label: '首页是否展示',
|
||||||
width: '100',
|
width: '150',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'info_article_order',
|
prop: 'info_article_order',
|
||||||
label: '文章排序',
|
label: '文章排序',
|
||||||
width: '180'
|
width: '180'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
prop: 'info_article_create_time',
|
||||||
|
label: '创建时间',
|
||||||
|
width: '180'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '操作',
|
label: '操作',
|
||||||
prop: 'chaoz',
|
prop: 'chaoz',
|
||||||
|
@ -49,7 +49,6 @@ 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({
|
||||||
info_article_type_sort: 1
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const uoloadData = ref({
|
const uoloadData = ref({
|
||||||
@ -67,12 +66,7 @@ const rules = reactive({
|
|||||||
message: '名称不能为空'
|
message: '名称不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
info_article_type_sort: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '排序不能为空'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// --基础方法
|
// --基础方法
|
||||||
|
@ -67,10 +67,7 @@ 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({});
|
||||||
home_env_sort: 1,
|
|
||||||
home_env_video: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
const uoloadData = {
|
const uoloadData = {
|
||||||
dirName: "HomeEnv"
|
dirName: "HomeEnv"
|
||||||
@ -87,12 +84,7 @@ const rules = reactive({
|
|||||||
// message: '图片不能为空'
|
// message: '图片不能为空'
|
||||||
// }
|
// }
|
||||||
// ],
|
// ],
|
||||||
home_env_sort: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '排序不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -105,19 +97,18 @@ const openDialog = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
formData.home_env_video = ''
|
|
||||||
handleResetClick(formRef.value);
|
handleResetClick(formRef.value);
|
||||||
dialogVisible.value = false;
|
dialogVisible.value = false;
|
||||||
emits("update:modelValue", false);
|
emits("update:modelValue", false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleAddClick = async (formEl) => {
|
const handleAddClick = async (formEl) => {
|
||||||
console.log(formData, 'asdas');
|
// if (!formEl) return;
|
||||||
if (!formEl) return;
|
|
||||||
formEl.validate(async (valid) => {
|
// formEl.validate(async (valid) => {
|
||||||
if (!valid) {
|
// if (!valid) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
isBtnLod.value = true;
|
isBtnLod.value = true;
|
||||||
|
|
||||||
const { code } = await addHomeEnv(formData);
|
const { code } = await addHomeEnv(formData);
|
||||||
@ -126,7 +117,7 @@ const handleAddClick = async (formEl) => {
|
|||||||
props.done();
|
props.done();
|
||||||
}
|
}
|
||||||
isBtnLod.value = flase;
|
isBtnLod.value = flase;
|
||||||
});
|
// });
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleResetClick = async (formEl) => {
|
const handleResetClick = async (formEl) => {
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="props.modelValue" title="首页环境详情" width="900px" @closed="closeDialog" @open="openDialog">
|
<el-dialog v-model="props.modelValue" title="首页环境详情" width="900px" @closed="closeDialog" @open="openDialog">
|
||||||
<el-form ref="formRef" :model="formData" :disabled="true">
|
<el-form ref="formRef" :model="formData" :disabled="true">
|
||||||
<el-row>
|
<el-row>
|
||||||
|
|
||||||
|
|
||||||
<el-col :span='12'>
|
<el-col :span='12'>
|
||||||
<el-form-item :label-width='labelWidth' label='图片' prop='home_env_img'>
|
<el-form-item :label-width='labelWidth' label='图片' prop='home_env_img'>
|
||||||
<UploadImage ref='uploadRef' v-model='formData.home_env_img' :data=uoloadData :limit='1' :fileSize='5'
|
<UploadImage ref='uploadRef' v-model='formData.home_env_img' :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="12">
|
<el-col :span="12">
|
||||||
<el-form-item :label-width="labelWidth" label="排序" prop="home_env_sort">
|
<el-form-item :label-width="labelWidth" label="排序" prop="home_env_sort">
|
||||||
<el-input-number v-model='formData.home_env_sort' controls-position='right' :min='1'></el-input-number>
|
<el-input-number v-model='formData.home_env_sort' controls-position='right' :min='1'></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -54,14 +54,14 @@ const formData = ref({
|
|||||||
// --基础方法
|
// --基础方法
|
||||||
watch(props, (v) => {
|
watch(props, (v) => {
|
||||||
formData.value = v.data;
|
formData.value = v.data;
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 打开弹窗时执行
|
// 打开弹窗时执行
|
||||||
const openDialog = () => {
|
const openDialog = () => {
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
@ -69,6 +69,4 @@ const closeDialog = () => {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped></style>
|
||||||
|
|
||||||
</style>
|
|
||||||
|
@ -2,20 +2,20 @@
|
|||||||
<el-dialog v-model="props.modelValue" title="编辑首页环境" width="900px" @closed="closeDialog" @open="openDialog">
|
<el-dialog v-model="props.modelValue" 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='home_env_img'>
|
<el-form-item :label-width='labelWidth' label='图片' prop='home_env_img'>
|
||||||
<UploadImage ref='uploadRef' v-model='formData.home_env_img' :data=uoloadData :limit='1' :fileSize='5'
|
<UploadImage ref='uploadRef' v-model='formData.home_env_img' :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="12">
|
<el-col :span="12">
|
||||||
<el-form-item :label-width="labelWidth" label="排序" prop="home_env_sort">
|
<el-form-item :label-width="labelWidth" label="排序" prop="home_env_sort">
|
||||||
<el-input-number v-model='formData.home_env_sort' controls-position='right' :min='1'></el-input-number>
|
<el-input-number v-model='formData.home_env_sort' controls-position='right' :min='1'></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, ref, watch } from "vue";
|
import { reactive, ref, watch } from "vue";
|
||||||
import { editHomeEnv } from "~/service/home_env";
|
import { editHomeEnv } from "~/service/home_env";
|
||||||
import { useLoginStore } from "~/store";
|
import { useLoginStore } from "~/store";
|
||||||
|
|
||||||
// --业务参数
|
// --业务参数
|
||||||
@ -69,13 +69,13 @@ const uoloadData = ref({
|
|||||||
// --基础方法
|
// --基础方法
|
||||||
watch(props, (v) => {
|
watch(props, (v) => {
|
||||||
formData.value = v.data;
|
formData.value = v.data;
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 打开弹窗时执行
|
// 打开弹窗时执行
|
||||||
const openDialog = () => {
|
const openDialog = () => {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
@ -84,19 +84,19 @@ const closeDialog = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
home_env_img: [
|
// home_env_img: [
|
||||||
{
|
// {
|
||||||
required: true,
|
// required: true,
|
||||||
message: '图片不能为空'
|
// message: '图片不能为空'
|
||||||
}
|
// }
|
||||||
],
|
// ],
|
||||||
home_env_sort: [
|
// home_env_sort: [
|
||||||
{
|
// {
|
||||||
required: true,
|
// required: true,
|
||||||
message: '排序不能为空'
|
// message: '排序不能为空'
|
||||||
}
|
// }
|
||||||
],
|
// ],
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleEditClick = async (formEl) => {
|
const handleEditClick = async (formEl) => {
|
||||||
@ -108,7 +108,7 @@ const handleEditClick = async (formEl) => {
|
|||||||
}
|
}
|
||||||
isBtnLod.value = true;
|
isBtnLod.value = true;
|
||||||
|
|
||||||
|
|
||||||
const { code } = await editHomeEnv(formData.value);
|
const { code } = await editHomeEnv(formData.value);
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
closeDialog();
|
closeDialog();
|
||||||
@ -123,6 +123,4 @@ const handleResetClick = async (formEl) => {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped></style>
|
||||||
|
|
||||||
</style>
|
|
||||||
|
@ -53,9 +53,7 @@ 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({});
|
||||||
home_env_sort: 1
|
|
||||||
});
|
|
||||||
|
|
||||||
const uoloadData = ref({
|
const uoloadData = ref({
|
||||||
dirName: "HomeEnv"
|
dirName: "HomeEnv"
|
||||||
@ -100,10 +98,10 @@ const handleAddClick = async (formEl) => {
|
|||||||
|
|
||||||
const { code } = await batchAddHomeEnv(formData);
|
const { code } = await batchAddHomeEnv(formData);
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
// closeDialog();
|
closeDialog();
|
||||||
// props.done();
|
props.done();
|
||||||
}
|
}
|
||||||
isBtnLod.value = flase;
|
isBtnLod.value = false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ 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({
|
||||||
home_works_sort: 1
|
// home_works_sort: 1
|
||||||
});
|
});
|
||||||
|
|
||||||
const uoloadData = ref({
|
const uoloadData = ref({
|
||||||
@ -105,12 +105,7 @@ const rules = reactive({
|
|||||||
message: '图片不能为空'
|
message: '图片不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
home_works_sort: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '排序不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -105,7 +105,7 @@
|
|||||||
import { ArrowDown } from '@element-plus/icons-vue';
|
import { ArrowDown } from '@element-plus/icons-vue';
|
||||||
import { ref, reactive, watch } from 'vue';
|
import { ref, reactive, watch } from 'vue';
|
||||||
import { useLoginStore } from "~/store";
|
import { useLoginStore } from "~/store";
|
||||||
import { getHomeWorksList, deleteHomeWorks, getDictionary, exportExcel } from '~/service/home_works';
|
import { getHomeWorksList, editHomeWorks , deleteHomeWorks, getDictionary, exportExcel } from '~/service/home_works';
|
||||||
import AddHomeWorksDialog from './components/AddHomeWorksDialog.vue';
|
import AddHomeWorksDialog from './components/AddHomeWorksDialog.vue';
|
||||||
import EditHomeWorksDialog from './components/EditHomeWorksDialog.vue';
|
import EditHomeWorksDialog from './components/EditHomeWorksDialog.vue';
|
||||||
import DetailHomeWorksDialog from './components/DetailHomeWorksDialog.vue';
|
import DetailHomeWorksDialog from './components/DetailHomeWorksDialog.vue';
|
||||||
|
@ -18,7 +18,14 @@
|
|||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item :label-width="labelWidth" label="排序" prop="joint_achievement_sort">
|
<el-form-item :label-width="labelWidth" label="排序" prop="joint_achievement_sort">
|
||||||
<el-input-number v-model='formData.joint_achievement_sort' controls-position='right' :min="1"></el-input-number>
|
<el-input-number v-model='formData.joint_achievement_sort' controls-position='right'
|
||||||
|
:min="1"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span='12'>
|
||||||
|
<el-form-item :label-width='labelWidth + 10' label='首页是否展示' prop='joint_achievement_status'>
|
||||||
|
<el-switch v-model='formData.joint_achievement_status' class='mt-2' inline-prompt :inactive-value=1
|
||||||
|
:active-value=2 style='--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949' />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
@ -26,22 +33,7 @@
|
|||||||
<RichText v-model='formData.joint_achievement_content' :min-height='196'></RichText>
|
<RichText v-model='formData.joint_achievement_content' :min-height='196'></RichText>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="首页是否展示" prop="joint_achievement_status">
|
|
||||||
<el-select
|
|
||||||
v-model="formData.joint_achievement_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-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@ -56,7 +48,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, ref, watch } from "vue";
|
import { reactive, ref, watch } from "vue";
|
||||||
import { addJointAchievement,getDictionary } from "~/service/joint_achievement";
|
import { addJointAchievement, getDictionary } from "~/service/joint_achievement";
|
||||||
import { useLoginStore } from "~/store";
|
import { useLoginStore } from "~/store";
|
||||||
|
|
||||||
// --业务参数
|
// --业务参数
|
||||||
@ -85,7 +77,6 @@ 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({
|
||||||
joint_achievement_sort: 1
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const uoloadData = ref({
|
const uoloadData = ref({
|
||||||
@ -109,12 +100,6 @@ const rules = reactive({
|
|||||||
message: '封面不能为空'
|
message: '封面不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
joint_achievement_sort: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '排序不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -87,7 +87,6 @@ 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({
|
||||||
achievement_sort: 1
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const uoloadData = ref({
|
const uoloadData = ref({
|
||||||
@ -123,12 +122,6 @@ const rules = reactive({
|
|||||||
message: '副内容不能为空'
|
message: '副内容不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
achievement_sort: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '排序不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -80,7 +80,6 @@ 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({
|
||||||
school_category_sort: 1
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const uoloadData = ref({
|
const uoloadData = ref({
|
||||||
@ -110,12 +109,7 @@ const rules = reactive({
|
|||||||
message: '图片不能为空'
|
message: '图片不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
school_category_sort: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '排序不能为空'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// --基础方法
|
// --基础方法
|
||||||
|
@ -90,7 +90,6 @@ 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({
|
||||||
school_leaders_sort: 1
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const uoloadData = ref({
|
const uoloadData = ref({
|
||||||
|
@ -72,7 +72,6 @@ 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({
|
||||||
subject_sort : 1,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const uoloadData = ref({
|
const uoloadData = ref({
|
||||||
@ -90,12 +89,7 @@ const rules = reactive({
|
|||||||
message: '科目名字不能为空'
|
message: '科目名字不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
subject_sort: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '排序不能为空'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// --基础方法
|
// --基础方法
|
||||||
|
@ -40,22 +40,20 @@
|
|||||||
<el-input rows="5" v-model="formData.teacher_intro" type="textarea" placeholder="请输入教师简介"></el-input>
|
<el-input rows="5" v-model="formData.teacher_intro" type="textarea" placeholder="请输入教师简介"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item :label-width="labelWidth" label="教师详情" prop="teacher_intro">
|
|
||||||
<RichText v-model="formData.teacher_content" :min-height="196"></RichText>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item :label-width="labelWidth" label="教师排序" prop="teacher_order">
|
<el-form-item :label-width="labelWidth" label="教师排序" prop="teacher_order">
|
||||||
<el-input-number v-model="formData.teacher_order" controls-position="right"></el-input-number>
|
<el-input-number v-model="formData.teacher_order" controls-position="right"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span='12'>
|
||||||
<el-form-item label="首页是否展示" prop="teacher_status">
|
<el-form-item :label-width='labelWidth + 10' label='首页是否展示' prop='teacher_status'>
|
||||||
<el-select v-model="formData.teacher_status" clearable placeholder="请选择">
|
<el-switch v-model='formData.teacher_status' class='mt-2' inline-prompt :inactive-value=1 :active-value=2
|
||||||
<el-option v-for="item in show_status" :key="item.dictionary_guid" :label="item.dictionary_name"
|
style='--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949' />
|
||||||
:value="item.dictionary_value"></el-option>
|
</el-form-item>
|
||||||
</el-select>
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="教师详情" prop="teacher_intro">
|
||||||
|
<RichText v-model="formData.teacher_content" :min-height="196"></RichText>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -116,7 +114,6 @@ 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({
|
||||||
teacher_order: 1
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const uoloadData = ref({
|
const uoloadData = ref({
|
||||||
@ -158,12 +155,7 @@ const rules = reactive({
|
|||||||
message: '教师简介不能为空'
|
message: '教师简介不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
teacher_order: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '教师排序不能为空'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// --基础方法
|
// --基础方法
|
||||||
|
@ -184,7 +184,7 @@ const params = reactive({
|
|||||||
teacher_name: '',
|
teacher_name: '',
|
||||||
teacher_position: '',
|
teacher_position: '',
|
||||||
subject_guid: '',
|
subject_guid: '',
|
||||||
|
teacher_status: ''
|
||||||
});
|
});
|
||||||
const column = [
|
const column = [
|
||||||
{
|
{
|
||||||
|
@ -1,166 +0,0 @@
|
|||||||
<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="test_name">
|
|
||||||
<el-input v-model='formData.test_name' type="text" placeholder='请输入名称'></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item :label-width='labelWidth' label='首页是否展示' prop='test_show_status'>
|
|
||||||
<el-switch
|
|
||||||
v-model='formData.test_show_status'
|
|
||||||
class='mt-2'
|
|
||||||
inline-prompt
|
|
||||||
:inactive-value=1
|
|
||||||
:active-value=2
|
|
||||||
style='--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949'
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item :label-width='labelWidth' label='评分' prop='test_score'>
|
|
||||||
<el-rate style='padding-top: 6px!important;' v-model='formData.test_score' allow-half />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item :label-width="labelWidth" label="排序" prop="test_sort">
|
|
||||||
<el-input-number v-model='formData.test_sort' controls-position='right' :min='1'></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 { addTest , getDictionary } from "~/service/test";
|
|
||||||
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 store = useLoginStore();
|
|
||||||
const headers = {
|
|
||||||
Accept: "application/json",
|
|
||||||
...store.headers,
|
|
||||||
};
|
|
||||||
|
|
||||||
const isBtnLod = ref(false);
|
|
||||||
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: "Test"
|
|
||||||
})
|
|
||||||
|
|
||||||
watch(props, (v) => {
|
|
||||||
dialogVisible.value = v.modelValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
const rules = reactive({
|
|
||||||
test_name: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '名称不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
test_show_status: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '首页是否展示不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
test_score: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '评分不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
test_sort: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '排序不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// --基础方法
|
|
||||||
|
|
||||||
// 打开弹窗时执行
|
|
||||||
const openDialog = () => {
|
|
||||||
get_show_status()
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
const closeDialog = () => {
|
|
||||||
handleResetClick(formRef.value);
|
|
||||||
dialogVisible.value = false;
|
|
||||||
emits("update:modelValue", false);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleAddClick = async (formEl) => {
|
|
||||||
if (!formEl) return;
|
|
||||||
formEl.validate(async (valid) => {
|
|
||||||
if (!valid) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
isBtnLod.value = true;
|
|
||||||
|
|
||||||
|
|
||||||
const { code } = await addTest(formData);
|
|
||||||
if (code == 0) {
|
|
||||||
closeDialog();
|
|
||||||
props.done();
|
|
||||||
}
|
|
||||||
isBtnLod.value = flase;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleResetClick = async (formEl) => {
|
|
||||||
if (!formEl) return;
|
|
||||||
formEl.resetFields();
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
|
|
||||||
</style>
|
|
@ -1,99 +0,0 @@
|
|||||||
<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="test_name">
|
|
||||||
<el-input v-model='formData.test_name' type="text" placeholder='请输入名称'></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item :label-width='labelWidth' label='首页是否展示' prop='test_show_status'>
|
|
||||||
<el-switch
|
|
||||||
v-model='formData.test_show_status'
|
|
||||||
class='mt-2'
|
|
||||||
inline-prompt
|
|
||||||
:inactive-value=1
|
|
||||||
:active-value=2
|
|
||||||
style='--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949'
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item :label-width='labelWidth' label='评分' prop='test_score'>
|
|
||||||
<el-rate style='padding-top: 6px!important;' v-model='formData.test_score' allow-half />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item :label-width="labelWidth" label="排序" prop="test_sort">
|
|
||||||
<el-input-number v-model='formData.test_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 { getDictionary } from '~/service/test';
|
|
||||||
|
|
||||||
// --业务参数
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// --业务方法
|
|
||||||
|
|
||||||
// 字典获取
|
|
||||||
const show_status = ref([]);
|
|
||||||
async function get_show_status() {
|
|
||||||
await getDictionary({ dictionary_value: 'show_status'}).then((res) => {
|
|
||||||
show_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()
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
const closeDialog = () => {
|
|
||||||
emits("update:modelValue", false);
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
|
|
||||||
</style>
|
|
@ -1,165 +0,0 @@
|
|||||||
<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="test_name">
|
|
||||||
<el-input v-model='formData.test_name' type="text" placeholder='请输入名称'></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item :label-width='labelWidth' label='首页是否展示' prop='test_show_status'>
|
|
||||||
<el-switch
|
|
||||||
v-model='formData.test_show_status'
|
|
||||||
class='mt-2'
|
|
||||||
inline-prompt
|
|
||||||
:inactive-value=1
|
|
||||||
:active-value=2
|
|
||||||
style='--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949'
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item :label-width='labelWidth' label='评分' prop='test_score'>
|
|
||||||
<el-rate style='padding-top: 6px!important;' v-model='formData.test_score' allow-half />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item :label-width="labelWidth" label="排序" prop="test_sort">
|
|
||||||
<el-input-number v-model='formData.test_sort' controls-position='right' :min='1'></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)" :loading="isBtnLod">编辑</el-button>
|
|
||||||
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { reactive, ref, watch } from "vue";
|
|
||||||
import { editTest , getDictionary } from "~/service/test";
|
|
||||||
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 store = useLoginStore();
|
|
||||||
const headers = {
|
|
||||||
Accept: "application/json",
|
|
||||||
...store.headers,
|
|
||||||
};
|
|
||||||
const isBtnLod = ref(false);
|
|
||||||
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: "Test"
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
// --基础方法
|
|
||||||
watch(props, (v) => {
|
|
||||||
formData.value = v.data;
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// 打开弹窗时执行
|
|
||||||
const openDialog = () => {
|
|
||||||
get_show_status()
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
const closeDialog = () => {
|
|
||||||
props.done();
|
|
||||||
emits("update:modelValue", false);
|
|
||||||
};
|
|
||||||
|
|
||||||
const rules = reactive({
|
|
||||||
test_name: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '名称不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
test_show_status: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '首页是否展示不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
test_score: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '评分不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
test_sort: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '排序不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleEditClick = async (formEl) => {
|
|
||||||
console.log(formData.value);
|
|
||||||
if (!formEl) return;
|
|
||||||
formEl.validate(async (valid) => {
|
|
||||||
if (!valid) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
isBtnLod.value = true;
|
|
||||||
|
|
||||||
|
|
||||||
const { code } = await editTest(formData.value);
|
|
||||||
if (code == 0) {
|
|
||||||
closeDialog();
|
|
||||||
props.done();
|
|
||||||
}
|
|
||||||
isBtnLod.value = false;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const handleResetClick = async (formEl) => {
|
|
||||||
if (!formEl) return;
|
|
||||||
formEl.resetFields();
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
|
|
||||||
</style>
|
|
@ -1,289 +0,0 @@
|
|||||||
<template>
|
|
||||||
<!-- 面包屑 -->
|
|
||||||
<el-breadcrumb>
|
|
||||||
<el-breadcrumb-item>测试管理</el-breadcrumb-item>
|
|
||||||
<el-breadcrumb-item to="/test/list">测试列表</el-breadcrumb-item>
|
|
||||||
</el-breadcrumb>
|
|
||||||
<!-- 搜索 -->
|
|
||||||
<el-form inline :model="params">
|
|
||||||
|
|
||||||
|
|
||||||
<el-form-item label="名称">
|
|
||||||
<el-input v-model='params.test_name' 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="addTestDialogVisible = true"> 添加 </el-button>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 导出 -->
|
|
||||||
<el-button icon="ElIconDocument" @click="exportExcel(params)">导出</el-button>
|
|
||||||
|
|
||||||
<!-- 导入 -->
|
|
||||||
<el-upload
|
|
||||||
class="upload-demo"
|
|
||||||
:action="importExcel"
|
|
||||||
:headers="headers"
|
|
||||||
:on-success="handleExcelSuccess"
|
|
||||||
:on-progress="uploadLoading"
|
|
||||||
:on-error="closeUploadLoading"
|
|
||||||
style="margin-left: 10px"
|
|
||||||
:show-file-list="false"
|
|
||||||
>
|
|
||||||
<el-button type="primary">导入</el-button>
|
|
||||||
</el-upload>
|
|
||||||
|
|
||||||
<!-- 下载导入模板 -->
|
|
||||||
<el-button icon="ElIconDownload" @click="downloadTemplate()"
|
|
||||||
>下载导入模板</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 => getTestList(params)"
|
|
||||||
>
|
|
||||||
|
|
||||||
|
|
||||||
<template #test_show_status='scope'>
|
|
||||||
<dict-tag :options='show_status' :value='scope.row.test_show_status' />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 排序 -->
|
|
||||||
<template #test_sort='scope'>
|
|
||||||
<el-input-number :disabled='loading' v-model='scope.row.test_sort' :min='1' controls-position='right'
|
|
||||||
@change='handleEditOrder(scope.row)'></el-input-number>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
|
|
||||||
<el-switch
|
|
||||||
:disabled=scope.row.test_show_status_bool
|
|
||||||
v-model=scope.row.test_show_status
|
|
||||||
class=mt-2
|
|
||||||
inline-prompt
|
|
||||||
:inactive-value=1
|
|
||||||
:active-value=2
|
|
||||||
style='--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949'
|
|
||||||
@click=handleEditShow(scope.row)
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
<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>
|
|
||||||
|
|
||||||
<!-- 添加测试 -->
|
|
||||||
<AddTestDialog v-model="addTestDialogVisible" :done="() => tableRef.reload()"></AddTestDialog>
|
|
||||||
<!-- 编辑测试 -->
|
|
||||||
<EditTestDialog
|
|
||||||
v-model="EditTestDialogVisible" :data="EditTestDialogRow" :done="() => tableRef.reload()"></EditTestDialog>
|
|
||||||
<!-- 测试详情 -->
|
|
||||||
<DetailTestDialog v-model="DetailTestDialogVisible" :data="DetailTestDialogRow"></DetailTestDialog>
|
|
||||||
</template>
|
|
||||||
<script setup>
|
|
||||||
import { ArrowDown } from '@element-plus/icons-vue';
|
|
||||||
import { ref, reactive,watch } from 'vue';
|
|
||||||
import { useLoginStore } from "~/store";
|
|
||||||
import { getTestList, deleteTest , getDictionary , exportExcel, downloadTemplate , importExcel } from '~/service/test';
|
|
||||||
import AddTestDialog from './components/AddTestDialog.vue';
|
|
||||||
import EditTestDialog from './components/EditTestDialog.vue';
|
|
||||||
import DetailTestDialog from './components/DetailTestDialog.vue';
|
|
||||||
|
|
||||||
const tableRef = ref();
|
|
||||||
const selectionData = ref([]);
|
|
||||||
const store = useLoginStore();
|
|
||||||
|
|
||||||
const addTestDialogVisible = ref(false);
|
|
||||||
const EditTestDialogVisible = ref(false);
|
|
||||||
const EditTestDialogRow = ref({});
|
|
||||||
const DetailTestDialogVisible = ref(false);
|
|
||||||
const DetailTestDialogRow = ref({});
|
|
||||||
|
|
||||||
const headers = {
|
|
||||||
Accept: "application/json",
|
|
||||||
...store.headers,
|
|
||||||
};
|
|
||||||
|
|
||||||
// 查询参数
|
|
||||||
const params = reactive({
|
|
||||||
test_name: "",
|
|
||||||
|
|
||||||
});
|
|
||||||
const column = [
|
|
||||||
|
|
||||||
{
|
|
||||||
fixed: true,
|
|
||||||
type: 'selection'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "test_name",
|
|
||||||
label: '名称',
|
|
||||||
width: '150'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "test_show_status",
|
|
||||||
label: '首页是否展示',
|
|
||||||
width: '150'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "test_score",
|
|
||||||
label: '评分',
|
|
||||||
width: '150'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "test_sort",
|
|
||||||
label: '排序',
|
|
||||||
width: '150'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
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 deleteTest({
|
|
||||||
test_guid: data.map(v => v.test_guid).join()
|
|
||||||
});
|
|
||||||
if (res) {
|
|
||||||
tableRef.value.reload();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 修改
|
|
||||||
function handleUpdate(row) {
|
|
||||||
EditTestDialogVisible.value = true
|
|
||||||
EditTestDialogRow.value = row
|
|
||||||
}
|
|
||||||
|
|
||||||
// 详情
|
|
||||||
function handleDetail(row) {
|
|
||||||
DetailTestDialogVisible.value = true
|
|
||||||
DetailTestDialogRow.value = row
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 导入方法
|
|
||||||
let loadingImoprt = null;
|
|
||||||
const uploadLoading = () => {
|
|
||||||
loadingImoprt = ElLoading.service({
|
|
||||||
lock: true,
|
|
||||||
text: "正在导入中...",
|
|
||||||
background: "rgba(255, 255, 255, 0.7)",
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const closeUploadLoading = () => loadingImoprt.close();
|
|
||||||
const handleExcelSuccess = (value) => {
|
|
||||||
if (value.code == 0) {
|
|
||||||
ElMessageBox.alert(value.msg, "导入信息", {
|
|
||||||
dangerouslyUseHTMLString: true,
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
ElMessage.error(value.msg);
|
|
||||||
}
|
|
||||||
closeUploadLoading();
|
|
||||||
tableRef.value.reload();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//排序
|
|
||||||
const loading = ref(false)
|
|
||||||
async function handleEditOrder(data) {
|
|
||||||
loading.value = true
|
|
||||||
const { code } = await editTest(data);
|
|
||||||
if (code == 0) {
|
|
||||||
loading.value = false
|
|
||||||
tableRef.value.reload()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 展示切换
|
|
||||||
async function handleEditShow(data) {
|
|
||||||
if(data.test_show_status === 1) return;
|
|
||||||
|
|
||||||
loading.value = true
|
|
||||||
const { code } = await editTest(data);
|
|
||||||
if (code == 0) {
|
|
||||||
loading.value = false
|
|
||||||
tableRef.value.reload()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 字典获取
|
|
||||||
const show_status = ref([]);
|
|
||||||
async function get_show_status() {
|
|
||||||
await getDictionary({ dictionary_value: 'show_status'}).then((res) => {
|
|
||||||
show_status.value = res
|
|
||||||
})
|
|
||||||
}
|
|
||||||
get_show_status()
|
|
||||||
</script>
|
|
@ -42,7 +42,7 @@
|
|||||||
</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="works_likes_count">
|
<el-form-item :label-width="labelWidth" label="排序" prop="works_likes_order">
|
||||||
<el-input-number v-model='formData.works_order' controls-position="right"></el-input-number>
|
<el-input-number v-model='formData.works_order' controls-position="right"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
@ -112,8 +112,7 @@ 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({
|
||||||
works_order: 1,
|
works_likes_count: 0
|
||||||
works_likes_count: 0,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const uoloadData = ref({
|
const uoloadData = ref({
|
||||||
@ -149,12 +148,6 @@ const rules = reactive({
|
|||||||
message: '作品点赞数不能为空'
|
message: '作品点赞数不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
works_order: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '排序不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
works_author_type: [
|
works_author_type: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -81,7 +81,6 @@ 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({
|
||||||
works_type_order: 0,
|
|
||||||
works_type_parent_guid: '0',
|
works_type_parent_guid: '0',
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -100,12 +99,6 @@ const rules = reactive({
|
|||||||
message: '作品类型名称不能为空'
|
message: '作品类型名称不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
works_type_order: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '作品类型排序不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user