master
lion 1 year ago
parent 12a7e2186f
commit b37caa4abf

@ -14,7 +14,7 @@ let loading ;
const service = axios.create({ const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests // withCredentials: true, // send cookies when cross-domain requests
timeout: 5000, // request timeout timeout: 10000, // request timeout
isLoading:true isLoading:true
}) })

@ -101,6 +101,29 @@
:edit-render="{ name: 'input', attrs: { type: 'text' } }" :edit-render="{ name: 'input', attrs: { type: 'text' } }"
/> />
<vxe-column
header-align="center"
field="is_show"
width="160"
title="自主招生显示"
:edit-render="{}"
>
<template #default="{ row }">
<div v-for="item in showList">
<div v-if="item.id==row.is_show">{{item.value}}</div>
</div>
</template>
<template #edit="{ row }">
<el-select size="small" v-model="row['is_show']">
<el-option
v-for="item in showList"
:key="item.id"
:value="item.id"
:label="item.value"></el-option>
</el-select>
</template>
</vxe-column>
<vxe-column <vxe-column
field="operate" field="operate"
header-align="center" header-align="center"
@ -206,6 +229,13 @@ export default {
loading: false, loading: false,
tableHeight: 400, tableHeight: 400,
showList: [{
id: 1,
value: '是'
}, {
id: 0,
value: '否'
}],
select: { select: {
page: 1, page: 1,
page_size: 20, page_size: 20,
@ -221,6 +251,7 @@ export default {
name: "", name: "",
group: "", group: "",
is_show:''
}, },
validRules: {}, validRules: {},
}; };

@ -1,194 +1,197 @@
<template> <template>
<div> <div>
<el-drawer <el-drawer :title="$route.meta.title" direction="rtl" size="68%" :visible.sync="visible" append-to-body
:title="$route.meta.title" :before-close="handleClose" @close="$emit('update:isShow', false)">
direction="rtl" <section class="drawer-container">
size="68%" <el-form class="drawer-container__form" ref="elForm" :model="form" :rules="rules" label-position="top"
:visible.sync="visible" label-width="120px" size="small">
append-to-body <div class="form-layout">
:before-close="handleClose" <el-form-item label="名称" prop="name">
@close="$emit('update:isShow', false)" <el-input v-model="form['name']" clearable placeholder="请填写名称" style="width: 100%"></el-input>
> </el-form-item>
<section class="drawer-container">
<el-form <el-form-item label="分组" prop="group">
class="drawer-container__form" <el-input v-model="form['group']" clearable placeholder="请填写分组" style="width: 100%"></el-input>
ref="elForm" </el-form-item>
:model="form" <el-form-item label="自主招生显示" prop="is_show">
:rules="rules" <el-select v-model="form['is_show']">
label-position="top" <el-option v-for="item in showList" :key="item.id" :label="item.value"
label-width="120px" :value="item.id"></el-option>
size="small" </el-select>
> </el-form-item>
<div class="form-layout"> </div>
<el-form-item label="名称" prop="name"> </el-form>
<el-input
v-model="form['name']" <div class="drawer-container__footer">
clearable <el-button @click="reset"> </el-button>
placeholder="请填写名称" <el-button type="primary" @click="submit" :loading="loading">{{
style="width: 100%" loading ? "提交中 ..." : "确 定"
></el-input> }}</el-button>
</el-form-item> </div>
</section>
<el-form-item label="分组" prop="group"> </el-drawer>
<el-input </div>
v-model="form['group']" </template>
clearable
placeholder="请填写分组" <script>
style="width: 100%" import {
></el-input> save,
</el-form-item> show
</div> } from "@/api/area/area";
</el-form> import axios from "axios";
import {
<div class="drawer-container__footer"> getToken
<el-button @click="reset"> </el-button> } from "@/utils/auth";
<el-button type="primary" @click="submit" :loading="loading">{{ import {
loading ? "提交中 ..." : "确 定" uploadSize
}}</el-button> } from "@/settings";
</div> import {
</section> formatFileSize
</el-drawer> } from "@/utils";
</div>
</template> export default {
name: "AreaDrawer",
<script> props: {
import { save, show } from "@/api/area/area"; isShow: {
import axios from "axios"; type: Boolean,
import { getToken } from "@/utils/auth"; default: false,
import { uploadSize } from "@/settings"; required: true,
import { formatFileSize } from "@/utils"; },
},
export default { data() {
name: "AreaDrawer", return {
props: { uploadSize,
isShow: { action: process.env.VUE_APP_UPLOAD_API,
type: Boolean, loading: false,
default: false, visible: false,
required: true, showList: [{
}, id: 1,
}, value: '是'
data() { }, {
return { id: 0,
uploadSize, value: '否'
action: process.env.VUE_APP_UPLOAD_API, }],
loading: false, form: {
visible: false, name: "",
form: {
name: "", group: "",
is_show: 1
group: "", },
}, rules: {},
rules: {}, };
}; },
}, watch: {
watch: { isShow(newVal) {
isShow(newVal) { this.visible = newVal;
this.visible = newVal; },
}, visible(newVal) {
visible(newVal) { this.$emit("update:isShow", newVal);
this.$emit("update:isShow", newVal); },
}, },
}, methods: {
methods: { uploadBefore(file) {
uploadBefore(file) { if (file.size > uploadSize) {
if (file.size > uploadSize) { this.$message({
this.$message({ type: "warning",
type: "warning", message: `上传图片大小超过${formatFileSize(uploadSize)}`,
message: `上传图片大小超过${formatFileSize(uploadSize)}`, });
}); return false;
return false; }
} window.$_uploading = true;
window.$_uploading = true; },
}, uploadSuccess(response, file, fileList, fieldName) {
uploadSuccess(response, file, fileList, fieldName) { window.$_uploading = false;
window.$_uploading = false; fileList.forEach((file) => {
fileList.forEach((file) => { if (file.response?.data && !file.response?.code) {
if (file.response?.data && !file.response?.code) { file.response = file.response.data;
file.response = file.response.data; }
} });
}); this.form[fieldName] = fileList;
this.form[fieldName] = fileList; },
}, uploadRemove(file, fileList, fieldName) {
uploadRemove(file, fileList, fieldName) { this.form[fieldName] = fileList;
this.form[fieldName] = fileList; },
}, uploadError(err, file, fileList, fieldName) {
uploadError(err, file, fileList, fieldName) { window.$_uploading = false;
window.$_uploading = false; this.form[fieldName] = fileList;
this.form[fieldName] = fileList; this.$message({
this.$message({ type: "warning",
type: "warning", message: err,
message: err, });
}); },
}, formatFileSize,
formatFileSize, getToken,
getToken, handleClose(done) {
handleClose(done) { this.$confirm("确定关闭窗口?")
this.$confirm("确定关闭窗口?") .then((_) => {
.then((_) => { done();
done(); })
}) .catch((_) => {});
.catch((_) => {}); },
},
reset() {
reset() { this.form = {
this.form = { name: "",
name: "",
group: "",
group: "", };
}; this.$refs["elForm"].resetFields();
this.$refs["elForm"].resetFields(); },
}, submit() {
submit() { if (window.$_uploading) {
if (window.$_uploading) { this.$message.warning("文件正在上传中");
this.$message.warning("文件正在上传中"); return;
return; }
}
this.$refs["elForm"].validate(async (valid) => {
this.$refs["elForm"].validate(async (valid) => { if (valid) {
if (valid) { this.loading = true;
this.loading = true; try {
try { await save(this.form);
await save(this.form); this.$message.success("新增成功");
this.$message.success("新增成功"); this.$emit("refresh");
this.$emit("refresh"); this.$emit("update:isShow", false);
this.$emit("update:isShow", false); this.loading = false;
this.loading = false; this.reset();
this.reset(); } catch (err) {
} catch (err) { this.loading = false;
this.loading = false; }
} }
} });
}); },
}, },
}, };
}; </script>
</script>
<style scoped lang="scss">
<style scoped lang="scss"> .span2 {
.span2 { grid-column: span 2;
grid-column: span 2; }
}
::v-deep .el-form-item > * { ::v-deep .el-form-item>* {
max-width: 100%; max-width: 100%;
} }
.form-layout {
display: grid; .form-layout {
grid-gap: 2%; display: grid;
grid-template-columns: repeat(2, 1fr); grid-gap: 2%;
} grid-template-columns: repeat(2, 1fr);
.drawer-container { }
height: 100%;
padding: 20px; .drawer-container {
display: flex; height: 100%;
flex-direction: column; padding: 20px;
display: flex;
&__form { flex-direction: column;
flex: 1;
overflow-y: scroll; &__form {
} flex: 1;
&__footer { overflow-y: scroll;
margin-top: 20px; }
display: flex;
} &__footer {
} margin-top: 20px;
display: flex;
}
}
</style> </style>

@ -357,6 +357,8 @@ export default {
page: 1, page: 1,
page_size: 20, page_size: 20,
keyword: "", keyword: "",
sort_type:'ASC',
sort_name:'sort',
show_relation: ["aspiration", "batchSubs"], show_relation: ["aspiration", "batchSubs"],
"filter[0][key]": 'aspiration_id', "filter[0][key]": 'aspiration_id',
"filter[0][op]": 'eq', "filter[0][op]": 'eq',

@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath * Detail: https://cli.vuejs.org/config/#publicpath
*/ */
publicPath: process.env.ENV === 'staging' ? '/admin_test' : '/admin', publicPath: process.env.ENV === 'staging' ? '/admin_test' : '/admin',
outputDir: `../git-store/zhiyuan/public/${process.env.ENV === 'staging' ? '/admin_test' : '/admin'}`, outputDir: `/Users/mac/Documents/朗业/2025/x-新飞跃/zhiyuan/public/${process.env.ENV === 'staging' ? '/admin_test' : '/admin'}`,
assetsDir: 'static', assetsDir: 'static',
css: { css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项 loaderOptions: { // 向 CSS 相关的 loader 传递选项

Loading…
Cancel
Save