|
|
|
|
@ -37,20 +37,29 @@
|
|
|
|
|
省份 :
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-select
|
|
|
|
|
multiple
|
|
|
|
|
v-model="form.province_ids"
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="请选择省份"
|
|
|
|
|
style="width: 300px"
|
|
|
|
|
<xy-table
|
|
|
|
|
ref="xyTable"
|
|
|
|
|
style="width: 560px"
|
|
|
|
|
:is-page="false"
|
|
|
|
|
:list="province_lists"
|
|
|
|
|
:table-item="provinceTable"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in province_lists"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.name"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
<template v-slot:btns></template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
<!-- <el-select-->
|
|
|
|
|
<!-- multiple-->
|
|
|
|
|
<!-- v-model="form.province_ids"-->
|
|
|
|
|
<!-- clearable-->
|
|
|
|
|
<!-- placeholder="请选择省份"-->
|
|
|
|
|
<!-- style="width: 300px"-->
|
|
|
|
|
<!-- >-->
|
|
|
|
|
<!-- <el-option-->
|
|
|
|
|
<!-- v-for="item in province_lists"-->
|
|
|
|
|
<!-- :key="item.id"-->
|
|
|
|
|
<!-- :label="item.name"-->
|
|
|
|
|
<!-- :value="item.id"-->
|
|
|
|
|
<!-- ></el-option>-->
|
|
|
|
|
<!-- </el-select>-->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
@ -123,7 +132,70 @@ export default {
|
|
|
|
|
type: "",
|
|
|
|
|
action: process.env.VUE_APP_UPLOAD_API,
|
|
|
|
|
fileList: [],
|
|
|
|
|
|
|
|
|
|
provinceTable: [
|
|
|
|
|
{
|
|
|
|
|
type: "selection",
|
|
|
|
|
width: 46,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: "name",
|
|
|
|
|
label: "省份",
|
|
|
|
|
width: 140,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "选课",
|
|
|
|
|
align:'left',
|
|
|
|
|
customFn: (row) => {
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
{row.subject?.map((item, index) => {
|
|
|
|
|
return (
|
|
|
|
|
<el-tag key={index} closeable={true}>
|
|
|
|
|
{item}
|
|
|
|
|
</el-tag>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
{row.inputVisible ? (
|
|
|
|
|
<el-input
|
|
|
|
|
class="input-new-tag"
|
|
|
|
|
v-model={row.inputValue}
|
|
|
|
|
ref="saveTagInput"
|
|
|
|
|
size="small"
|
|
|
|
|
on={{
|
|
|
|
|
["blur"]: (e) => {
|
|
|
|
|
if(!row.subject){
|
|
|
|
|
row.subject = []
|
|
|
|
|
}
|
|
|
|
|
let inputValue = row.inputValue;
|
|
|
|
|
if (inputValue) {
|
|
|
|
|
row.subject?.push(inputValue);
|
|
|
|
|
}
|
|
|
|
|
row.inputVisible = false;
|
|
|
|
|
row.inputValue = "";
|
|
|
|
|
},
|
|
|
|
|
}}
|
|
|
|
|
></el-input>
|
|
|
|
|
) : (
|
|
|
|
|
<el-button
|
|
|
|
|
class="button-new-tag"
|
|
|
|
|
size="small"
|
|
|
|
|
on={{
|
|
|
|
|
["click"]: (e) => {
|
|
|
|
|
row.inputVisible = true;
|
|
|
|
|
this.$nextTick((_) => {
|
|
|
|
|
this.$refs['saveTagInput']?.$refs?.input?.focus()
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
+ 新增
|
|
|
|
|
</el-button>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
form: {
|
|
|
|
|
year: "",
|
|
|
|
|
province_ids: "",
|
|
|
|
|
@ -137,12 +209,6 @@ export default {
|
|
|
|
|
message: "请填写年份",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
province_ids: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "请填写录取查询省份说明",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
@ -151,8 +217,8 @@ export default {
|
|
|
|
|
successHandle(response, file, fileList) {
|
|
|
|
|
this.fileList = fileList;
|
|
|
|
|
},
|
|
|
|
|
removeHande(file,fileList){
|
|
|
|
|
this.fileList = fileList
|
|
|
|
|
removeHande(file, fileList) {
|
|
|
|
|
this.fileList = fileList;
|
|
|
|
|
},
|
|
|
|
|
uploadBefore(file) {
|
|
|
|
|
console.log(file);
|
|
|
|
|
@ -169,22 +235,28 @@ export default {
|
|
|
|
|
let res = await show({
|
|
|
|
|
id: this.id,
|
|
|
|
|
});
|
|
|
|
|
res.year = String(res?.year)
|
|
|
|
|
res.province_ids = res?.province_ids?.map(item => Number(item))
|
|
|
|
|
this.fileList = res.files.map(item => {
|
|
|
|
|
res.year = String(res?.year);
|
|
|
|
|
res.province_ids = res?.province_ids?.map((item) => Number(item));
|
|
|
|
|
this.fileList = res.files.map((item) => {
|
|
|
|
|
return {
|
|
|
|
|
name:item.original_name,
|
|
|
|
|
url:item.url,
|
|
|
|
|
response:item
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
name: item.original_name,
|
|
|
|
|
url: item.url,
|
|
|
|
|
response: item,
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
this.$integrateData(this.form, res);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
submit() {
|
|
|
|
|
this.form.file_ids = this.fileList.map((item) => {
|
|
|
|
|
return item?.response?.id;
|
|
|
|
|
});
|
|
|
|
|
if(this.$refs["xyTable"].getSelection().length > 0){
|
|
|
|
|
this.form.province_ids = this.$refs["xyTable"].getSelection().map(item => {
|
|
|
|
|
return {
|
|
|
|
|
province_id:item.id,
|
|
|
|
|
province_name:item.name,
|
|
|
|
|
subjec:item.subject.toString()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.type === "add") {
|
|
|
|
|
if (this.form.hasOwnProperty("id")) {
|
|
|
|
|
@ -277,3 +349,20 @@ export default {
|
|
|
|
|
text-align: left;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<style>
|
|
|
|
|
.el-tag + .el-tag {
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
}
|
|
|
|
|
.button-new-tag {
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
height: 32px;
|
|
|
|
|
line-height: 30px;
|
|
|
|
|
padding-top: 0;
|
|
|
|
|
padding-bottom: 0;
|
|
|
|
|
}
|
|
|
|
|
.input-new-tag {
|
|
|
|
|
width: 90px;
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
vertical-align: bottom;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|