bug fix and performance improvements
This commit is contained in:
@ -10,7 +10,8 @@
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item :show-message="false" label="所属领域:" prop="industrys">
|
||||
<!-- :show-message="false"-->
|
||||
<el-form-item label="所属领域:" prop="industrys">
|
||||
<el-row justify="space-between" type="flex">
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
@ -96,7 +97,7 @@
|
||||
// import { industry } from "@/api/config";
|
||||
import {listSysIndustry} from "@/api/platform/industry";
|
||||
import {ElMessage} from "element-plus";
|
||||
import { reactive, toRefs, watch } from "vue";
|
||||
import {reactive, ref, toRefs, watch} from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
@ -213,6 +214,7 @@ const handleFieldClose = (index) => {
|
||||
};
|
||||
|
||||
const validateForm = async () => {
|
||||
console.log(modelValue.value.industrys)
|
||||
try {
|
||||
return await formRef.value.validate();
|
||||
} catch (error) {
|
||||
@ -221,7 +223,7 @@ const validateForm = async () => {
|
||||
};
|
||||
|
||||
getIndustryTreeData();
|
||||
|
||||
fields.value = []
|
||||
watch(
|
||||
modelValue,
|
||||
(newVal) => {
|
||||
|
@ -16,9 +16,9 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属站点" prop="tenantId">
|
||||
<SiteOptions v-model="queryParams.tenantId" :site-list="siteList" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="所属站点" prop="tenantId">-->
|
||||
<!-- <SiteOptions v-model="queryParams.tenantId" :site-list="siteList" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="联系人" prop="contact">
|
||||
<el-input
|
||||
v-model="queryParams.contact"
|
||||
@ -45,10 +45,12 @@
|
||||
icon="search"
|
||||
size="default"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
>搜索
|
||||
</el-button
|
||||
>
|
||||
<el-button icon="refresh" size="default" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>重置
|
||||
</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -61,7 +63,8 @@
|
||||
icon="plus"
|
||||
size="default"
|
||||
@click="handleAdd"
|
||||
>新增</el-button
|
||||
>新增
|
||||
</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
@ -125,11 +128,11 @@
|
||||
</router-link>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="站点" align="center">
|
||||
<template #default="{ row }">
|
||||
{{ siteList.find((el) => el.id === row.tenantId)?.name ?? "无" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="站点" align="center">-->
|
||||
<!-- <template #default="{ row }">-->
|
||||
<!-- {{ siteList.find((el) => el.id === row.tenantId)?.name ?? "无" }}-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="联系人" prop="contact" align="center"/>
|
||||
<el-table-column label="手机号码" prop="contactMobile" align="center"/>
|
||||
<el-table-column label="发布时间" align="center" width="100">
|
||||
@ -149,21 +152,24 @@
|
||||
type="text"
|
||||
icon="notebook"
|
||||
@click="router.push(`./signUp?id=${row.id}`)"
|
||||
>报名名单</el-button
|
||||
>报名名单
|
||||
</el-button
|
||||
>
|
||||
<el-button
|
||||
size="small"
|
||||
type="text"
|
||||
icon="edit"
|
||||
@click="handleUpdate(row)"
|
||||
>编辑</el-button
|
||||
>编辑
|
||||
</el-button
|
||||
>
|
||||
<el-button
|
||||
size="small"
|
||||
type="text"
|
||||
icon="delete"
|
||||
@click="handleDelete(row)"
|
||||
>删除</el-button
|
||||
>删除
|
||||
</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -176,11 +182,11 @@
|
||||
@pagination="getList"
|
||||
/>
|
||||
<!-- 添加或修改对话框 -->
|
||||
<el-dialog :title="title" v-model="showEditDialog" width="55%">
|
||||
<el-dialog :title="title" v-model="showEditDialog" width="55%" destroy-on-close>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="所属站点" prop="tenantId">
|
||||
<SiteOptions v-model="form.tenantId" :site-list="siteList" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="所属站点" prop="tenantId">-->
|
||||
<!-- <SiteOptions v-model="form.tenantId" :site-list="siteList" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="活动名称:" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入活动名称"/>
|
||||
</el-form-item>
|
||||
@ -221,7 +227,17 @@
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<CityOptions v-model="form" ref="cityOptionsRef" />
|
||||
<!-- 国家-->
|
||||
<el-form-item
|
||||
label="国家"
|
||||
prop="country"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.country"
|
||||
placeholder="请输入国家"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <CityOptions v-model="form" ref="cityOptionsRef"/>-->
|
||||
<!-- <el-form-item label="地点:" required>
|
||||
<el-row type="flex" justify="space-between" :gutter="10">
|
||||
<el-col :span="8">
|
||||
@ -369,7 +385,13 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="活动介绍:" prop="content">
|
||||
<WangEditor v-model="form.content" minHeight="150px" />
|
||||
<!-- <WangEditor v-model="form.content" minHeight="150px" />-->
|
||||
<el-input
|
||||
v-model="form.content"
|
||||
placeholder="请输入活动介绍"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 6, maxRows: 8 }"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="报名费用:" prop="amount">
|
||||
<el-input v-model.number="form.amount">
|
||||
@ -386,32 +408,17 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Active">
|
||||
import SiteOptions from "@/views/components/SiteOptions";
|
||||
// import CityOptions from "../../../components/CityOptions";
|
||||
import {
|
||||
activityList,
|
||||
activityAdd,
|
||||
activityDetail,
|
||||
activityEdit,
|
||||
activityDelete,
|
||||
} from "@/api/website/activity";
|
||||
import {activityAdd, activityDelete, activityDetail, activityEdit, activityList,} from "@/api/website/activity";
|
||||
import {tenantSelect} from "@/api/subPlatform/tenant";
|
||||
import {
|
||||
areaList,
|
||||
industry,
|
||||
identity,
|
||||
provinceList,
|
||||
cityList,
|
||||
districtList,
|
||||
} from "@/api/config";
|
||||
import {cityList, districtList, industry, provinceList,} from "@/api/config";
|
||||
import FieldOptions from "@/views/components/FieldOptions";
|
||||
// import { cloneDeep } from "lodash";
|
||||
import { reactive, toRefs } from "vue";
|
||||
import {reactive, ref, toRefs} from "vue";
|
||||
// import { constants } from "buffer";
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import WangEditor from "@/components/WangEditor/index.vue";
|
||||
// import SiteOptions from "@/views/components/SiteOptions";
|
||||
import {useRouter} from "vue-router";
|
||||
|
||||
const router = useRouter();
|
||||
const dataList = ref([]);
|
||||
const loading = ref(true);
|
||||
@ -457,11 +464,6 @@ const data = reactive({
|
||||
contact: [{required: true, message: "联系人不能为空", trigger: "blur"}],
|
||||
contactMobile: [
|
||||
{required: true, message: "手机号码不能为空", trigger: "blur"},
|
||||
{
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
tenantId: [
|
||||
{
|
||||
@ -473,6 +475,7 @@ const data = reactive({
|
||||
beginTime: [
|
||||
{required: true, message: "开始时间不能为空", trigger: "change"},
|
||||
],
|
||||
country: [{required: true, message: "请输入国家", trigger: "change"}],
|
||||
finishTime: [
|
||||
{required: true, message: "结束时间不能为空", trigger: "change"},
|
||||
],
|
||||
@ -648,7 +651,7 @@ const handleUpdate = async (row) => {
|
||||
};
|
||||
|
||||
// const siteOptionsRef = ref();
|
||||
const cityOptionsRef = ref();
|
||||
// const cityOptionsRef = ref();
|
||||
const fieldOptionsRef = ref();
|
||||
const submitForm = async () => {
|
||||
// let notifys = 0;
|
||||
@ -656,11 +659,11 @@ const submitForm = async () => {
|
||||
// formData.notifyCrowd = notifys;
|
||||
// formData.industrys = [form.value.industrys.join("-")];
|
||||
// const siteOptionsValid =
|
||||
const cityOptionsValid = await cityOptionsRef.value.validateForm();
|
||||
// const cityOptionsValid = await cityOptionsRef.value.validateForm();
|
||||
const fieldOptionsValid = await fieldOptionsRef.value.validateForm();
|
||||
const valid = await formRef.value.validate();
|
||||
form.value.notifyCrowd = form.value.notifyCrowds.join(",");
|
||||
if (!valid || !cityOptionsValid || !fieldOptionsValid) {
|
||||
if (!valid || !fieldOptionsValid) {
|
||||
console.log("校验未通过");
|
||||
return;
|
||||
}
|
||||
@ -687,7 +690,8 @@ const handleDelete = (row) => {
|
||||
getList();
|
||||
ElMessage.success("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => {
|
||||
});
|
||||
};
|
||||
|
||||
getList();
|
||||
|
Reference in New Issue
Block a user