master
xy 3 years ago
parent 8b12ab06d9
commit b328f1574c

@ -1,6 +1,6 @@
import request from "@/utils/request";
export function index(isLoading = true,params){
export function index(params,isLoading = true){
return request({
url:"/api/admin/province/index",
method:"get",
@ -9,7 +9,7 @@ export function index(isLoading = true,params){
})
}
export function show(isLoading = true,params){
export function show(params,isLoading = true){
return request({
url:"/api/admin/province/show",
method:"get",
@ -18,19 +18,21 @@ export function show(isLoading = true,params){
})
}
export function save(data){
export function save(data,isLoading = true){
return request({
url:"/api/admin/province/save",
method:"post",
data
data,
isLoading
})
}
export function destroy(params){
export function destroy(params,isLoading = true){
return request({
url:"/api/admin/province/destroy",
method:"get",
params
params,
isLoading
})
}

@ -1,15 +1,15 @@
import request from "@/utils/request";
export function index(isLoading = true,params){
export function index(params,isLoading = true){
return request({
url:"/api/admin/specialize/index",
method:"get",
isLoading,
params
params,
})
}
export function show(isLoading = true,params){
export function show(params,isLoading = true){
return request({
url:"/api/admin/specialize/show",
method:"get",
@ -18,19 +18,21 @@ export function show(isLoading = true,params){
})
}
export function save(data){
export function save(data,isLoading = true){
return request({
url:"/api/admin/specialize/save",
method:"post",
data
data,
isLoading
})
}
export function destroy(params){
export function destroy(params,isLoading = true){
return request({
url:"/api/admin/specialize/destroy",
method:"get",
params
params,
isLoading
})
}

@ -1,6 +1,6 @@
import request from "@/utils/request";
export function index(isLoading = true,params){
export function index(params,isLoading = true){
return request({
url:"/api/admin/progress/index",
method:"get",
@ -9,7 +9,7 @@ export function index(isLoading = true,params){
})
}
export function show(isLoading = true,params){
export function show(params,isLoading = true){
return request({
url:"/api/admin/progress/show",
method:"get",
@ -18,23 +18,25 @@ export function show(isLoading = true,params){
})
}
export function save(data){
export function save(data,isLoading = true){
return request({
url:"/api/admin/progress/save",
method:"post",
data
data,
isLoading
})
}
export function destroy(params){
export function destroy(params,isLoading = true){
return request({
url:"/api/admin/progress/destroy",
method:"get",
params
params,
isLoading
})
}
export function init(isLoading = true,data){
export function init(data,isLoading = true){
return request({
url:"/api/admin/progress/init",
method:"post",

@ -0,0 +1,38 @@
import request from "@/utils/request";
export function index(params,isLoading = true){
return request({
url:"/api/admin/template/index",
method:"get",
isLoading,
params
})
}
export function show(params,isLoading = true){
return request({
url:"/api/admin/template/show",
method:"get",
isLoading,
params
})
}
export function save(data,isLoading = true){
return request({
url:"/api/admin/template/save",
method:"post",
data,
isLoading
})
}
export function destroy(params,isLoading = true){
return request({
url:"/api/admin/template/destroy",
method:"get",
params,
isLoading
})
}

@ -0,0 +1,38 @@
import request from "@/utils/request";
export function index(params,isLoading = true){
return request({
url:"/api/admin/template_filed/index",
method:"get",
isLoading,
params
})
}
export function show(params,isLoading = true){
return request({
url:"/api/admin/template_filed/show",
method:"get",
isLoading,
params
})
}
export function save(data,isLoading = true){
return request({
url:"/api/admin/template_filed/save",
method:"post",
data,
isLoading
})
}
export function destroy(params,isLoading = true){
return request({
url:"/api/admin/template_filed/destroy",
method:"get",
params,
isLoading
})
}

@ -0,0 +1,38 @@
import request from "@/utils/request";
export function index(params,isLoading = true){
return request({
url:"/api/admin/year_socre/index",
method:"get",
isLoading,
params
})
}
export function show(params,isLoading = true){
return request({
url:"/api/admin/year_socre/show",
method:"get",
isLoading,
params
})
}
export function save(data,isLoading = true){
return request({
url:"/api/admin/year_socre/save",
method:"post",
data,
isLoading
})
}
export function destroy(params,isLoading = true){
return request({
url:"/api/admin/year_socre/destroy",
method:"get",
params,
isLoading
})
}

@ -1,15 +1,16 @@
<script>
import axios from 'axios';
import {getToken} from "@/utils/auth";
import axios from "axios";
import { getToken } from "@/utils/auth";
export default {
props: {
//
action:[String,Function], //String Functionpromise
reqOpt:Object, //
resProp:{
type:String,
default:'data'
},//
action: [String, Function], //String Functionpromise
destroyAction: [Function], //promise
reqOpt: Object, //
resProp: {
type: String,
default: "data",
}, //
//
auths: {
@ -171,19 +172,20 @@ export default {
return {
isBtns: false,
tableHeight: null,
//document.documentElement.clientHeight -50 -37 - 20- 25 - 76,
//document.documentElement.clientHeight -50 -37 - 20- 25 - 76,
isShowPage: true,
checkTable: this.tableItem.map((item) => item?.prop),
loading: false,
visibleBtn: true, //
sortFlag:0,
totalData:0,
listData:[],
selectOpt:{
page:1,
page_size:10,
sort_name:'',
sort_type:''
totalData: 0,
listData: [],
selectOpt: {
page: 1,
page_size: 10,
sort_name: "",
sort_type: "",
},
};
},
@ -191,7 +193,9 @@ export default {
//
initLoad() {
let clientHeight = document.documentElement.clientHeight;
let lxheader = document.querySelector('.v-header').getBoundingClientRect()
let lxheader = document
.querySelector(".v-header")
.getBoundingClientRect();
let lxHeader_height = lxheader.height + 25; //
let paginationHeight = 37; //
let topHeight = 50; //
@ -199,61 +203,71 @@ export default {
clientHeight - lxHeader_height - topHeight - paginationHeight - 20 - 25;
//console.log(this.tableHeight)
},
getTableData(isRefresh = false){
if(isRefresh){
this.selectOpt.page = 1
getTableData(isRefresh = false) {
if (isRefresh) {
this.selectOpt.page = 1;
}
switch (typeof this.action){
switch (typeof this.action) {
case "string":
this.loading = true
this.loading = true;
axios({
baseURL:process.env.VUE_APP_BASE_API,
url:this.action,
headers:{
Authorization:"Bearer " + getToken()
baseURL: process.env.VUE_APP_BASE_API,
url: this.action,
headers: {
Authorization: "Bearer " + getToken(),
},
params:(this.reqOpt.method && this.reqOpt.method === 'get') ? this.selectOpt : '',
data:(this.reqOpt.method && this.reqOpt.method === 'post') ? this.selectOpt : '',
...this.reqOpt
}).then(res => {
this.listData = this.getByStrkey(res.data,this.resProp)
this.totalData = res.data.total
setTimeout(() => {
this.loading = false
},300)
}).catch(err => {
console.error(err)
this.loading = false
params:
this.reqOpt.method && this.reqOpt.method === "get"
? this.selectOpt
: "",
data:
this.reqOpt.method && this.reqOpt.method === "post"
? this.selectOpt
: "",
...this.reqOpt,
})
.then((res) => {
this.listData = this.getByStrkey(res.data, this.resProp);
this.totalData = res.data.total;
setTimeout(() => {
this.loading = false;
}, 300);
})
.catch((err) => {
console.error(err);
this.loading = false;
});
break;
case "function":
this.loading = true
this.action(false,{
this.loading = true;
this.action({
...this.selectOpt,
...this.reqOpt
}).then(res => {
this.listData = this.getByStrkey(res,this.resProp)
this.totalData = res.total
setTimeout(() => {
this.loading = false
},300)
}).catch(err => {
console.error(err)
this.loading = false
})
...this.reqOpt,
},false)
.then((res) => {
this.listData = this.getByStrkey(res, this.resProp);
this.totalData = res.total;
setTimeout(() => {
this.loading = false;
}, 300);
})
.catch((err) => {
console.error(err);
this.loading = false;
});
break;
}
},
getByStrkey(obj,str){
if(!str) return obj
getByStrkey(obj, str) {
if (!str) return obj;
let res = this.deepCopy(obj);
let keys = str.split('.')
keys.forEach(key => {
res = res[key]
})
let keys = str.split(".");
keys.forEach((key) => {
res = res[key];
});
return res;
},
deepCopy(data){
deepCopy(data) {
//string,number,bool,null,undefined,symbol
//object,array,date
if (data && typeof data === "object") {
@ -294,19 +308,26 @@ export default {
return data;
}
},
sortListener({column, prop, order}){
this.selectOpt.sort_name = prop
switch (order){
case "ascending":
this.selectOpt.sort_type = 'ASC'
break;
case "descending":
this.selectOpt.sort_type = 'DESC'
break;
default:
this.selectOpt.sort_type = ''
sortListener({ column, prop, order }) {
if(prop === this.selectOpt.sort_name){
this.sortFlag ++
}else{
this.sortFlag = 0
}
this.getTableData()
this.selectOpt.sort_name = prop;
this.selectOpt.sort_type = ['ASC','DESC',null][this.sortFlag % 3]
// TODO:
// switch (order) {
// case "ascending":
// this.selectOpt.sort_type = "ASC";
// break;
// case "descending":
// this.selectOpt.sort_type = "DESC";
// break;
// default:
// this.selectOpt.sort_type = "";
// }
this.getTableData();
},
//element table
@ -399,10 +420,21 @@ export default {
this.$emit("expand-change", row, expanded);
},
deleteClick(row) {
this.$emit('delete', row)
this.$emit("delete", row);
if (this.destroyAction) {
this.destroyAction({
id: row.id,
},false).then((res) => {
this.$message({
type: "success",
message: "删除成功",
});
this.getTableData();
});
}
},
editorClick(row) {
this.$emit('editor', row)
this.$emit("editor", row);
},
createPage() {
@ -418,27 +450,31 @@ export default {
show-total={true}
page-size={this.pageSize}
v-show={this.isShowPage}
total={this.action ? (this.totalData || this.listData.length) : this.total}
total={
this.action
? this.totalData || this.listData.length
: this.total
}
size="small"
show-elevator={true}
show-sizer={this.showSizer}
class="xy-table__page"
on={{
["on-page-size-change"]: (e) => {
if(this.action){
this.selectOpt.page_size = e
this.selectOpt.page = 1
this.getTableData()
if (this.action) {
this.selectOpt.page_size = e;
this.selectOpt.page = 1;
this.getTableData();
}
this.$emit("pageSizeChange", e)
this.$emit("pageSizeChange", e);
},
["on-change"]: (e) => {
if(this.action){
this.selectOpt.page = e
this.getTableData()
if (this.action) {
this.selectOpt.page = e;
this.getTableData();
}
this.$emit("pageIndexChange", e)
}
this.$emit("pageIndexChange", e);
},
}}
></Page>
</transition>
@ -452,11 +488,13 @@ export default {
return (
<el-checkbox-group v-model={this.checkTable}>
{this.$props?.tableItem?.map((item, index) => {
return item.type !== 'expand' ? (
return item.type !== "expand" ? (
<el-checkbox label={item.prop} key={item.prop}>
{item.label}
</el-checkbox>
) : ''
) : (
""
);
})}
</el-checkbox-group>
);
@ -573,7 +611,7 @@ export default {
},
},
created() {
this.getTableData()
this.getTableData();
},
mounted() {
this.initLoad();
@ -581,7 +619,7 @@ export default {
updated() {
this.$nextTick(() => {
this.doLayout();
})
});
},
render(h) {
let { $scopedSlots } = this;
@ -638,7 +676,9 @@ export default {
["row-dblclick"]: this.rowDblclick,
["header-click"]: this.headerClick,
["header-contextmenu"]: this.headerContextmenu,
["sort-change"]: this.action ? this.sortListener : this.sortChange,
["sort-change"]: this.action
? this.sortListener
: this.sortChange,
["filter-change"]: this.filterChange,
["current-change"]: this.currentChange,
["header-dragend"]: this.headerDragend,
@ -651,9 +691,12 @@ export default {
}
return (
<el-table-column
key={String(Math.random())+index}
// TODO: keysort
//key={`xy-table-col-${item.prop}`}
key={String(Math.random()) + index}
type={item.type}
index={item.index}
//column-key={`xy-table-column-${item.prop}`}
column-key={String(Math.random())}
label={item.label}
prop={item.prop}
@ -694,17 +737,18 @@ export default {
: ""
}
>
{ item.multiHd
{item.multiHd
? item.multiHd.map((item1, index1) => {
return (
<el-table-column
key={`xy-table-col-multi-${item1.prop}`}
//key={`xy-table-col-multi-${item1.prop}`}
key={String(Math.random()) + index1}
prop={`${item.pProp ? item.pProp + "." : ""}${
item1.prop
}`}
type={item1.type}
index={item1.index}
column-key={String(Math.random())}
column-key={String(Math.random() + index1)}
label={item1.label}
prop={item1.prop}
width={item1.width ?? "auto"}
@ -717,7 +761,9 @@ export default {
sort-orders={item1.sortOrders}
resizale={item1.resizale ?? false}
formatter={item1.formatter}
show-overflow-tooltip={item1.showOverflowTooltip ?? true}
show-overflow-tooltip={
item1.showOverflowTooltip ?? true
}
align={item1.align ?? "center"}
header-align={item1.headerAlign ?? "center"}
class-name={`xy-table__row-fade ${item1.className}`}
@ -745,10 +791,10 @@ export default {
</el-table-column>
);
})}
{ $scopedSlots.btns ? $scopedSlots.btns() : this.isCreateAuthBtns() }
{$scopedSlots.btns ? $scopedSlots.btns() : this.isCreateAuthBtns()}
</el-table>
) : (
<el-table height={this.height ?? this.tableHeight} />
<el-table ref="table" height={this.height ?? this.tableHeight} />
)}
<el-backtop
@ -757,7 +803,7 @@ export default {
bottom={100}
right={36}
></el-backtop>
{ this.createPage() }
{this.createPage()}
</div>
);
},

@ -62,7 +62,10 @@ const state = {
*/
const pathHandler = (path,id) => {
if(path.includes('$')){
return path.replace(/\$+/g,"")
return path.replace(/^\$+/g,"")
}
if(path.includes('^')){
return path.replace(/^\^+/g,"")
}
if(path.includes('#') || path == ''){
return id + '_key'
@ -78,15 +81,42 @@ const componentHandler = (path) => {
return ()=>import('@/layout/noLayout')
}
if(path.includes('$')){
return loadView(path.replace(/\$+/g,""))
return loadView(path.replace(/^\$+/g,""))
}
if(path.includes('^')){
return loadView(path.replace(/^\^+/g,""))
}
return loadView(path)
}
// 为#,左边栏根目录无视图,##下级根目录无视图,$不显示在左边栏视图,^左边栏根目录有视图
export function generaMenu(routes, data) {
data.forEach(item => {
if (item.url === "/") {
} else if(/^\^/.test(item.url)){
const menu = {
path: pathHandler(item.url,item.id),
component: Layout,
children: [{
path: "",
name: 'menu_' + item.id,
component: componentHandler(item.url),
meta: {
title: item.name,
id: item.id,
roles: ['admin'],
auths:item.has_auth_node_tags,
icon: item.icon
}
}, ]
}
if (item.children) {
generaMenu(menu.children, item.children)
}
routes.push(menu)
} else {
const menu = {
path: pathHandler(item.url,item.id),

@ -88,7 +88,9 @@
methods: {
async getDetail() {
const res = await show(this.id)
const res = await show({
id:this.id
})
this.$integrateData(this.form, res)
},

@ -72,7 +72,7 @@
methods: {
async getDetail() {
const res = await show(false,{
const res = await show({
id:this.id
})
this.$integrateData(this.form, res)

@ -23,20 +23,13 @@
ref="xyTable"
:table-item="table"
:action="index"
:destroy-action="destroy"
:auths="auths_auth_mixin"
@editor="row => {
$refs['addProvince'].id = row.id;
$refs['addProvince'].type = 'editor';
$refs['addProvince'].isShow = true
}"
@delete="row => {
destroy({
id:row.id
}).then(res => {
$successMessage('destroy','省份')
$refs['xyTable'].getTableData()
})
}"
></xy-table>
<addProvince

@ -27,6 +27,7 @@
<xy-table
ref="xyTable"
:action="index"
:destroy-action="destroy"
:table-item="table"
:auths="auths_auth_mixin"
@editor="row => {
@ -34,14 +35,6 @@
$refs['addSpecialize'].type = 'editor';
$refs['addSpecialize'].isShow = true
}"
@delete="row => {
destroy({
id:row.id
}).then(res => {
$successMessage('destroy','专业')
$refs['xyTable'].getTableData()
})
}"
></xy-table>
<add-specialize

@ -120,7 +120,7 @@
getProgressStatus,
async getDetail() {
const res = await show(true,{
const res = await show({
id:this.id
})
this.$integrateData(this.form, res)

@ -0,0 +1,128 @@
<template>
<div>
<xy-dialog
ref="dialog"
:is-show.sync="isShow"
type="form"
:title="type === 'add' ? '新增模板' : '编辑模板'"
:form="form"
:rules="rules"
@submit="submit"
>
<template v-slot:year>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red; font-weight: 600; padding-right: 4px"
>*</span
>
年份
</div>
<div class="xy-table-item-content">
<el-date-picker
type="year"
v-model="form.year"
placeholder="请选择年份"
style="width: 300px"
value-format="yyyy"
></el-date-picker>
</div>
</div>
</template>
<template v-slot:remark>
<div class="xy-table-item">
<div class="xy-table-item-label">录取查询说明 </div>
<div class="xy-table-item-content">
<el-input
type="textarea"
:autosize="{ minRows: 2 }"
v-model="form.remark"
clearable
placeholder="请输入录取查询说明 "
style="width: 300px"
/>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import { show, save } from "@/api/unifiedRecruitment/template";
export default {
props: {},
data() {
return {
isShow: false,
id: "",
type: "",
form: {
year: "",
remark: "",
is_open:0
},
rules: {
year: [
{
required: true,
message: "请填写年份",
},
],
},
};
},
methods: {
async getDetail() {
const res = await show(true, {
id: this.id,
});
this.$integrateData(this.form, res);
},
submit() {
if (this.type === "add") {
if (this.form.hasOwnProperty("id")) {
delete this.form.id;
}
}
if (this.type === "editor") {
Object.defineProperty(this.form, "id", {
value: this.id,
enumerable: true,
configurable: true,
writable: true,
});
}
save(this.form).then((res) => {
this.$successMessage(this.type, "");
this.isShow = false;
this.$emit("refresh");
});
},
},
watch: {
isShow(val) {
if (val) {
if (this.type === "editor") {
this.getDetail();
}
} else {
this.id = "";
this.type = "";
this.$refs["dialog"].reset();
delete this.form.id;
}
},
},
};
</script>
<style scoped lang="scss">
::v-deep .el-input__inner {
text-align: left;
}
.xy-table-item-label {
width: 160px;
}
</style>

@ -1,22 +1,42 @@
<template>
<div>
<Modal width="52" :value="isShow" @on-visible-change="e => $emit('update:isShow',e)">
<div>
<Modal
title="初始化"
width="52"
:value="isShow"
:loading="true"
@on-ok="submit"
@on-visible-change="(e) => $emit('update:isShow', e)"
>
<div class="label">
<div class="label_title">年份</div>
<el-date-picker
size="small"
type="year"
placement="bottom"
placeholder="年份选择"
style="width: 160px"
value-format="yyyy"
v-model="select.year"
@change="$refs['xyTable'].getTableData()"
size="small"
type="year"
placement="bottom"
placeholder="年份选择"
style="width: 160px"
value-format="yyyy"
v-model="select.year"
@change="
(e) => {
$refs['xyTable'].getTableData();
form.year = e;
}
"
></el-date-picker>
</div>
<div>
<xy-table ref="xyTable" :action="index" :req-opt="select" :is-page="false" :table-item="table">
<div class="label_title">录取省份</div>
<xy-table
ref="xyTable"
:action="index"
:req-opt="select"
:is-page="false"
:table-item="table"
@selection-change="selectChange"
>
<template v-slot:btns></template>
</xy-table>
</div>
@ -25,31 +45,32 @@
</template>
<script>
import { index } from "@/api/unifiedRecruitment/progress"
import {getProgressStatus} from "@/const";
import { index,init } from "@/api/unifiedRecruitment/progress";
export default {
props:{
isShow:{
type:Boolean,
default:false
props: {
isShow: {
type: Boolean,
default: false,
},
provinces: {
type:Array,
default:() => []
}
type: Array,
default: () => [],
},
},
data() {
return {
select:{
year:"",
page_size:9999
select: {
year: String(new Date().getFullYear()),
page_size: 9999,
page: 1,
},
table:[
table: [
{
width:60,
align:'center',
headerAlign:'center',
type:"selection"
width: 60,
align: "center",
headerAlign: "center",
type: "selection",
},
{
prop: "province_id",
@ -57,9 +78,9 @@ export default {
width: 140,
formatter: (cell, data, val) => {
return (
this.provinces.filter((item) => {
return val === item.id;
})[0]?.name || val
this.provinces.filter((item) => {
return val === item.id;
})[0]?.name || val
);
},
},
@ -67,23 +88,89 @@ export default {
prop: "start_date",
label: "开始时间",
minWidth: 160,
sortable: "custom",
customFn: (row) => {
return (
<el-date-picker
size="small"
placement="bottom"
placeholder="开始时间"
type="date"
v-model={row.start_date}
value-format="yyyy-MM-dd"
></el-date-picker>
);
},
},
{
prop: "end_date",
label: "结束时间",
minWidth: 160,
sortable: "custom",
}
customFn: (row) => {
return (
<el-date-picker
size="small"
placement="bottom"
placeholder="结束时间"
type="date"
v-model={row.end_date}
value-format="yyyy-MM-dd"
></el-date-picker>
);
},
},
],
}
form: {
year: String(new Date().getFullYear()),
detail: [],
},
};
},
methods: {
index,
selectChange(selection) {
this.form.detail = selection.map((item) => {
return {
id: item.id,
start_date: item.start_date,
end_date: item.end_date,
};
});
},
submit(){
if(this.form.detail.length <= 0){
this.$message({
type:'warning',
message:"请选择需要初始化数据"
})
return
}
init(this.form).then(res => {
this.$message({
type:'success',
message:"初始化成功"
})
this.$emit("update:isShow",false)
})
}
},
computed: {},
}
watch: {
isShow(newVal) {
if (newVal) {
this.$refs["xyTable"].getTableData();
}
},
},
};
</script>
<style scoped lang="scss">
.label {
&_title {
font-weight: 600;
padding: 10px 0;
}
}
</style>

@ -0,0 +1,61 @@
<template>
<div>
<Modal
title="模板设置"
width="52"
:value="isShow"
:loading="true"
@on-ok="submit"
@on-visible-change="(e) => $emit('update:isShow', e)"
>
<xy-table ref="xyTable" :is-page="false" :action="show" res-prop="fields" :req-opt="{id}" :table-item="table"></xy-table>
</Modal>
</div>
</template>
<script>
import { index } from '@/api/unifiedRecruitment/templateFiled'
import { show } from '@/api/unifiedRecruitment/template'
export default {
props: {
isShow: {
type: Boolean,
default: false,
},
},
data() {
return {
id:'',
select: {
},
form: {
},
table:[
]
};
},
methods: {
id() {
return id
},
show,
submit(){
}
},
computed: {},
watch: {
isShow(newVal) {
if (newVal) {
this.$refs['xyTable'].getTableData()
}
},
},
};
</script>
<style scoped lang="scss">
</style>

@ -43,6 +43,7 @@
ref="xyTable"
:req-opt="select"
:action="index"
:destroy-action="destroy"
:table-item="table"
:auths="auths_auth_mixin"
@editor="
@ -67,7 +68,7 @@
<script>
import { authMixin } from "@/mixin/authMixin";
import { index as provinceIndex } from "@/api/manage/province";
import { index } from "@/api/unifiedRecruitment/progress";
import { index,destroy } from "@/api/unifiedRecruitment/progress";
import { getProgressStatus } from "@/const";
import addProgress from "./component/addProgress.vue";
@ -136,11 +137,12 @@ export default {
},
methods: {
index,
destroy,
async getProvinces() {
const res = await provinceIndex(false, {
const res = await provinceIndex({
page: 1,
page_size: 9999,
});
},false);
this.provinces = res.data;
},
},

@ -0,0 +1,136 @@
<template>
<div>
<div ref="lxHeader">
<lx-header
icon="md-apps"
style="margin-bottom: 10px; border: 0px; margin-top: 15px"
text="统招模版"
>
<div slot="content"></div>
<slot>
<header-content :auths="auths_auth_mixin">
<template v-slot:search>
<el-date-picker
size="small"
type="year"
placement="bottom"
placeholder="年份选择"
style="width: 160px"
value-format="yyyy"
v-model="select.year"
@change="$refs['xyTable'].getTableData()"
></el-date-picker>
</template>
<template v-slot:create>
<Button
type="primary"
@click="
($refs['addTemplate'].type = 'add'),
($refs['addTemplate'].isShow = true)
"
>新建</Button
>
</template>
</header-content>
</slot>
</lx-header>
</div>
<xy-table
ref="xyTable"
:req-opt="select"
:action="index"
:destroy-action="destroy"
:table-item="table"
:auths="auths_auth_mixin"
@editor=""
>
<template v-slot:setting="scope">
<Button
size="small"
type="primary"
ghost
@click="e => {
$refs['setting'].id = scope.row.id
isShowSetting = true
}"
>模版设置</Button
>
</template>
</xy-table>
<addTemplate
ref="addTemplate"
@refresh="$refs['xyTable'].getTableData()"
></addTemplate>
<setting ref="setting" :is-show.sync="isShowSetting"></setting>
</div>
</template>
<script>
import { index, destroy, save } from "@/api/unifiedRecruitment/template";
import { authMixin } from "@/mixin/authMixin";
import addTemplate from "./component/addTemplate.vue";
import setting from "./component/setting.vue";
export default {
mixins: [authMixin],
components: {
addTemplate,
setting,
},
data() {
return {
isShowSetting: false,
select: {
year: "",
},
table: [
{
prop: "year",
label: "年份",
width: 140,
sortable: "custom",
},
{
prop: "remark",
label: "录取查询说明",
align: "left",
minWidth: 300,
},
{
label: "是否开放查询",
width: 190,
customFn: (row) => {
return (
<el-switch
v-model={row.is_open}
inactive-text="否"
active-text="是"
inactive-value={0}
active-value={1}
on={{
["change"]: (e) => {
save(row).then((res) => {
this.$refs["xyTable"].getTableData();
});
},
}}
></el-switch>
);
},
},
],
};
},
methods: {
index,
destroy,
},
computed: {},
};
</script>
<style scoped lang="scss"></style>

@ -0,0 +1,215 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增历年分数' : '编辑历年分数'" :form="form" :rules="rules" @submit="submit">
<template v-slot:year>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>
年份
</div>
<div class="xy-table-item-content">
<el-date-picker type="year" v-model="form.year" placeholder="请选择年份" style="width: 300px;" value-format="yyyy"></el-date-picker>
</div>
</div>
</template>
<template v-slot:province_list>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>
省份
</div>
<div class="xy-table-item-content">
<el-select multiple value-key="province_id" v-model="form.province_list" clearable placeholder="请选择省份" style="width: 300px;" @change="provinceChange">
<el-option v-for="item in province_lists" :key="item.id" :label="item.name" :value="{province_id:item.id}"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:remark>
<div class="xy-table-item">
<div class="xy-table-item-label">
备注
</div>
<div class="xy-table-item-content">
<el-input type="textarea" :autosize="{minRows:2}" v-model="form.remark " clearable placeholder="请输入备注 " style="width: 300px;" />
</div>
</div>
</template>
<template v-slot:file_ids>
<div class="xy-table-item">
<div class="xy-table-item-label">
文件
</div>
<div class="xy-table-item-content">
<div v-if="form.avatar" style="position: relative;">
<img :src="form.avatar" class="avatar">
<Button class="img__delete" icon="md-close" shape="circle" size="small" type="error" @click="form.file_ids = ''"></Button>
</div>
<el-upload v-else :action="action" :before-upload="uploadBefore" :limit="1" :on-error="uploadFail" :on-success="uploadSuccess" :show-file-list="true" accept="picture" class="avatar-uploader" list-type="picture-card">
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
show,
save
} from '@/api/yearScore/yearScore';
export default {
props:{
province_lists: {
type:Array,
default:()=>[]
},
},
data() {
return {
isShow: false,
id: '',
type: '',
action: process.env.VUE_APP_UPLOAD_API,
form: {
year: "",
province_list: "",
remark: "",
file_ids: "",
},
rules: {
year: [{
required: true,
message: "请填写年份"
}],
province_list: [{
required: true,
message: "请填写录取查询省份说明"
}],
}
}
},
methods: {
provinceChange(e){
console.log(e)
},
//
uploadFail(err) {
console.log(err)
},
uploadSuccess(response) {
console.log(response)
this.form.avatar = response.id
},
uploadBefore(file) {
console.log(file)
if ((file.size / 1000) > 2024) {
this.$message({
type: 'warning',
message: '上传图片大小超过2M'
})
return false
}
},
async getDetail() {
const res = await show(this.id)
this.$integrateData(this.form, res)
},
submit() {
if(this.type === 'add'){
if(this.form.hasOwnProperty('id')){
delete this.form.id
}
}
if (this.type === 'editor') {
Object.defineProperty(this.form, 'id', {
value: this.id,
enumerable: true,
configurable: true,
writable: true
})
}
save(this.form).then(res => {
this.$successMessage(this.type, '')
this.isShow = false
this.$emit('refresh')
})
}
},
watch: {
isShow(val) {
if (val) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.type = ''
this.$refs['dialog'].reset()
delete this.form.id
}
}
}
}
</script>
<style scoped lang="scss">
::v-deep .el-input__inner {
text-align: left;
}
.img__delete {
transform: scale(0.8, 0.8);
position: absolute;
top: 4px;
right: 4px;
}
::v-deep .avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
::v-deep .avatar-uploader .el-upload:hover {
border-color: $primaryColor;
}
::v-deep .el-upload--picture-card {
font-size: 28px;
color: #8c939d;
width: 80px !important;
height: 80px !important;
line-height: 80px !important;
text-align: center;
}
::v-deep .avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 80px !important;
height: 80px !important;
line-height: 80px !important;
text-align: center;
}
::v-deep .avatar {
width: 80px !important;
display: block;
border-radius: 6px;
}
::v-deep .el-input__inner {
text-align: left;
}
</style>

@ -0,0 +1,95 @@
<template>
<div>
<div ref="lxHeader">
<lx-header
icon="md-apps"
style="margin-bottom: 10px; border: 0px; margin-top: 15px"
text="统招进度"
>
<div slot="content"></div>
<slot>
<header-content :auths="auths_auth_mixin">
<template v-slot:search>
<el-date-picker
size="small"
type="year"
placement="bottom"
placeholder="年份选择"
style="width: 160px"
value-format="yyyy"
v-model="select.year"
@change="$refs['xyTable'].getTableData()"
></el-date-picker>
</template>
<template v-slot:create>
<Button
type="primary"
@click="
($refs['addYearScore'].type = 'add'),
($refs['addYearScore'].isShow = true)
"
>新建</Button
>
</template>
</header-content>
</slot>
</lx-header>
</div>
<xy-table
ref="xyTable"
:req-opt="select"
:action="index"
:table-item="table"
:auths="auths_auth_mixin"
@editor=""
></xy-table>
<addYearScore
ref="addYearScore"
:province_lists="provinces"
@refresh="$refs['xyTable'].getTableData()"
></addYearScore>
</div>
</template>
<script>
import { index } from "@/api/yearScore/yearScore";
import { authMixin } from "@/mixin/authMixin";
import { index as provinceIndex } from "@/api/manage/province";
import addYearScore from "./component/addYearScore.vue";
export default {
mixins: [authMixin],
components: {
addYearScore,
},
data() {
return {
provinces:[],
select: {
year: "",
},
table: [],
};
},
methods: {
index,
async getProvinces(){
const res = await provinceIndex({
page:1,
page_size:9999
},false)
this.provinces = res.data
}
},
computed: {},
created() {
this.getProvinces()
}
};
</script>
<style scoped lang="scss"></style>

@ -31,6 +31,9 @@ module.exports = {
loaderOptions: { // 向 CSS 相关的 loader 传递选项
less: {
javascriptEnabled: true
},
sass:{
prependData: '@import "@/styles/index.scss";'
}
}
},

Loading…
Cancel
Save