Browse Source

组件重置逻辑修改、整合页面内容

clientSet-zq-1128
zq 3 days ago
parent
commit
18badd3a2a
  1. 1
      src/components/SetLeftMenu.vue
  2. 313
      src/components/clientSet/clientForm.vue
  3. 2
      src/views/super/clientSet/catalogPage.vue
  4. 20
      src/views/super/clientSet/coverInfoPage.vue
  5. 2
      src/views/super/clientSet/headerPage.vue
  6. 58
      src/views/super/clientSet/mainTextPage.vue
  7. 77
      src/views/super/clientSet/summaryPage.vue
  8. 100
      src/views/super/paiban/college.vue
  9. 106
      src/views/super/paiban/orderlist.vue
  10. 2
      src/views/super/paiban/tpl.vue

1
src/components/SetLeftMenu.vue

@ -55,6 +55,7 @@ export default {
}
if(newPath.includes('/super/clientSet')){
store.dispatch('fetchClientConfig',{id:this.$route.query.id});
store.commit('SET_CLIENTTEMTYPE', this.$route.query.type);
}
this.updateActiveMenu(newPath);
}

313
src/components/clientSet/clientForm.vue

@ -1,16 +1,20 @@
<template>
<div class="client_form" id="">
<div class="before_h_title mb24">{{ title }} <span class="desc" v-if="desc">{{ desc }}</span></div>
<div class="client_form" id="" :key="dataKey">
<div class="before_h_title mb24" v-if="title">{{ title }} <span class="desc" v-if="desc">{{ desc }}</span></div>
<el-form :model="coverInfo" v-if="coverInfo">
<!-- 中英文关键词-前缀 -->
<div class="flex mt20" v-if="eng_keywords || ch_keywords">
<div class="flex mt20" v-if="ch_keywords">
<div class="flex-label">
<div class="label-text">前缀</div>
<span class="colon"></span>
</div>
<span class="desc" v-if="ch_keywords">"关键词"三个字</span>
<span class="desc" v-if="eng_keywords">"key word"单词</span>
<!-- <span class="desc" v-if="eng_keywords">"key word"单词</span> -->
</div>
<div class="flex-label mt20" v-if="eng_keywords">
<div class="label-text">关键词</div>
<span class="colon"></span>
</div>
<GuipRadio :options="titlePosList" v-if="titlePosFlag" v-model="coverInfo.title_pos" :client-form-flex="true"
label="标题位置" />
@ -68,7 +72,7 @@
</div>
</div>
<!-- 中英文关键词 -->
<div class="mt20" v-if="eng_keywords || ch_keywords">
<div class="mt20" v-if="false">
<div class="flex-label mt20">
<div class="label-text">关键词</div>
<span class="colon"></span>
@ -81,7 +85,7 @@
label="字号" :unit="coverInfo.font.en.font_size.unit" width="127px" />
</div>
<GuipRadio :options="boldList" v-model="coverInfo.font.en.bold" :client-form-flex="true" label="字重" />
<GuipInput class="grayUnit" v-model="delimiter" :client-form-flex="true" placeholder="请填写" label="分隔符"
<GuipInput v-if="false" class="grayUnit" v-model="delimiter" :client-form-flex="true" placeholder="请填写" label="分隔符"
@blur="checkGrammar" :unit="grammarCheck" />
</div>
</div>
@ -140,7 +144,7 @@ export default {
props: {
title: {
type: String,
default: '封面信息'
default: ''
},
desc: {
type: String,
@ -218,10 +222,12 @@ export default {
},
data() {
return {
targetOriginalData: null,
dataKey:Date.now(),
// - JSON
// title_pos: '', //
// img_pos: '', //
indentation: '1', //
indentation: '0', //
// spe_format: '', //
// delimiter: '', //
coverInfo: {
@ -308,7 +314,7 @@ export default {
};
},
computed: {
...mapState(['client_tpl_options']),
...mapState(['client_tpl_options','client_tpl_type']),
// client_tpl_options
zhFontOptions() {
@ -368,7 +374,6 @@ export default {
//
initData: {
handler(newData) {
console.log(newData,'newData====000');
if (newData && Object.keys(newData).length > 0) {
this.setFormData(newData);
}
@ -446,97 +451,125 @@ export default {
* 取消/重置按钮点击
*/
cancelClick() {
if (this.externalCancelMethod) {
this.externalCancelMethod(this.coverInfo);
} else {
// if (this.externalCancelMethod) {
// this.externalCancelMethod(this.coverInfo);
// } else {
this.internalCancel();
}
this.$emit('cancel', this.coverInfo);
// }
// this.$emit('cancel', this.coverInfo);
},
/**
* 提交按钮点击
*/
submitDoctorBaseInfo() {
//
// if (!this.fontDetailflag && this.coverInfo.font.en.font) {
// this.coverInfo.font.zh.font = this.coverInfo.font.en.font;
// this.coverInfo.font.zh.font_size.value = this.coverInfo.font.en.font_size.value;
// this.coverInfo.font.zh.bold = this.coverInfo.font.en.bold;
// }
// if (this.externalSubmitMethod) {
// this.externalSubmitMethod(this.coverInfo);
// } else {
// this.internalSubmit();
// }
console.log(this.getFormData(),'====--000');
this.$emit('submit', this.getFormData());
},
/**
/**
* 内部重置方法
*/
internalCancel() {
//
this.coverInfo = {
title_pos: '',
img_pos: '',
indentation: '',
spe_format: '',
delimiter: '',
content: {
font: {
zh: {
font: '',
font_size: {
unit: 'pt',
value: ''
},
bold: 'False'
},
en: {
font: '',
font_size: {
unit: 'pt',
value: ''
},
bold: 'False'
}
},
alignment: '',
indentation: {
first_line_indent: {
unit: 'character',
value: ''
},
text_before_indent: {
unit: 'character',
//
if (this.client_tpl_type === 'edit' && this.targetOriginalData) {
// initData
this.restoreTargetOriginalData();
} else {
// 使
this.defaultReset();
}
},
/**
* 恢复目标原始数据
*/
restoreTargetOriginalData() {
console.log('zoudaozhelide ');
//
this.coverInfo = this.getDefaultCoverInfo();
console.log('this.targetOriginalData===',this.targetOriginalData);
//
this.processLevelData(this.targetOriginalData);
this.dataKey= Date.now();
// UI
this.delimiter = '';
this.grammarCheck = '';
//
if (this.targetOriginalData.indentation &&
this.targetOriginalData.indentation.first_line_indent?.value &&
parseInt(this.targetOriginalData.indentation.first_line_indent.value) > 0) {
this.indentation = '1';
} else {
this.indentation = '0';
}
},
/**
* 默认重置创建状态
*/
defaultReset() {
console.log('这里');
this.coverInfo = this.getDefaultCoverInfo();
this.indentation = '1'; //
this.delimiter = '';
this.grammarCheck = '';
},
/**
* 获取默认的 coverInfo 结构
*/
getDefaultCoverInfo() {
return {
font: {
zh: {
font: '',
font_size: {
unit: 'pt',
value: ''
},
text_end_indent: {
unit: 'character',
value: ''
}
bold: 'True'
},
spacing: {
line_spacing: {
unit: 'multiple',
value: ''
},
paragraph_before_spacing: {
en: {
font: '',
font_size: {
unit: 'pt',
value: ''
},
paragraph_end_spacing: {
unit: 'pt',
value: ''
}
bold: 'True'
}
},
alignment: '',
indentation: {
first_line_indent: {
unit: 'character',
value: '0'
},
text_before_indent: {
unit: 'character',
value: ''
},
text_end_indent: {
unit: 'character',
value: ''
}
},
spacing: {
line_spacing: {
unit: 'multiple',
value: ''
},
paragraph_before_spacing: {
unit: 'pt',
value: ''
},
paragraph_end_spacing: {
unit: 'pt',
value: ''
}
}
};
this.delimiter = '';
this.grammarCheck = '';
},
/**
@ -609,15 +642,15 @@ export default {
indentation: {
first_line_indent: {
unit: this.coverInfo.indentation.first_line_indent.unit,
value: this.coverInfo.indentation.first_line_indent.value
value: this.coverInfo.indentation.first_line_indent.value
},
text_before_indent: {
unit: this.coverInfo.indentation.text_before_indent.unit,
value: this.coverInfo.indentation.text_before_indent.value
value: this.indentation == '1' ? this.coverInfo.indentation.text_before_indent.value : ''
},
text_end_indent: {
unit: this.coverInfo.indentation.text_end_indent.unit,
value: this.coverInfo.indentation.text_end_indent.value
value: this.indentation == '1' ? this.coverInfo.indentation.text_end_indent.value : ''
}
},
spacing: {
@ -642,9 +675,33 @@ export default {
* @param {Object} data 表单数据
*/
setFormData(data) {
//
// outputStructure
// const extractedData = this.extractDataByStructure(data, this.outputStructure);
// console.log(extractedData,'extractedData====',this.outputStructure);
//
this.targetOriginalData = JSON.parse(JSON.stringify(data));
this.processLevelData(data)
},
extractDataByStructure(data, structure) {
if (!structure || structure.length === 0) {
return data;
}
let result = data;
for (const key of structure) {
if (result && typeof result === 'object' && key in result) {
result = result[key];
} else {
//
console.log(result,'====8888');
return {};
}
}
console.log(result,'====000');
return result || {};
},
/**
* 处理包含数组的层级数据
* @param {Object} levelData level_1_heading数据
@ -831,102 +888,10 @@ export default {
}
}
}
},
/**
* 重置表单供外部调用
*/
resetForm() {
this.internalCancel();
},
/**
* 验证表单
*/
validateForm() {
const errors = [];
if (!this.coverInfo.font.en.font_size.value) {
errors.push('字号不能为空');
}
if (!this.coverInfo.alignment) {
errors.push('请选择对齐方式');
}
return {
valid: errors.length === 0,
errors: errors
};
},
/**
* 获取特定字段值
*/
getFieldValue(field) {
const keys = field.split('.');
let value = this.coverInfo;
for (const key of keys) {
if (value && typeof value === 'object' && key in value) {
value = value[key];
} else {
return undefined;
}
}
return value;
},
/**
* 设置特定字段值
*/
setFieldValue(field, value) {
const keys = field.split('.');
let obj = this.coverInfo;
for (let i = 0; i < keys.length - 1; i++) {
if (!(keys[i] in obj)) {
this.$set(obj, keys[i], {});
}
obj = obj[keys[i]];
}
const lastKey = keys[keys.length - 1];
this.$set(obj, lastKey, value);
}
}
};
</script>
<!--
<style scoped>
.grayLabel {
background-color: #f5f5f5;
padding: 10px;
border-radius: 4px;
margin-top: 10px;
}
.showIndentation {
margin-top: 15px;
}
.flex-between {
display: flex;
justify-content: space-between;
margin-bottom: 15px;
}
.flex-between:last-child {
margin-bottom: 0;
}
.mt20 {
margin-top: 20px;
}
.mb24 {
margin-bottom: 24px;
}
</style> -->
<style scoped lang="scss">
.client_flex-common .el-form-item__label {
width: 100px;

2
src/views/super/clientSet/catalogPage.vue

@ -3,7 +3,7 @@
<h3 class="pageTitle">目录</h3>
<div class="flex-between flex-common" id="mainTextTitle">
<ClientForm ref="oneLevelRef" title="一级标题" :init-data="level1HeadingData" :titlePosFlag="false"
@cancel="(data) => handleCancelEvent(data, 'oneLevel')"
:outputStructure="one"
@submit="(data) => submitConfig(data, 'oneLevel')" />
<ClientForm ref="twoLevelRef" title="二级标题" :titlePosFlag="false"

20
src/views/super/clientSet/coverInfoPage.vue

@ -28,7 +28,7 @@
<div class="client_flex-common flex-common mt12" id="">
<div class="before_h_title mb24">封面样式</div>
<div class="flex mt12">
<img v-if="coverStyle" :src="coverStyle.qrcode_path" class="kefuImg mr-12">
<img v-if="client_tpl_config" :src="client_tpl_config.cover" class="kefuImg mr-12">
<div class="qqCode-wrap">
<el-upload class="avatar-uploader mt12" accept=".jpg,.png" :on-change="handleQQkfChange" action="#"
:before-upload="beforeAvatarUpload"
@ -125,7 +125,7 @@ export default {
};
},
computed: {
...mapState(['client_tpl_review_status']),
...mapState(['client_tpl_config']),
},
mounted() {
const {id,type} = this.$route.query;
@ -217,14 +217,14 @@ export default {
},
handleWordChange(file, fileList) {
console.log(file, fileList)
if (file.raw) {
const isLt2M = file.raw.size / 1024 / 1024 < 2;
if (!isLt2M) {
this.$Message.error('上传图片大小不能超过 2MB!');
this.$refs.avatorUpload.clearFiles();
return;
}
}
// if (file.raw) {
// const isLt2M = file.raw.size / 1024 / 1024 < 2;
// if (!isLt2M) {
// this.$Message.error(' 2MB!');
// this.$refs.avatorUpload.clearFiles();
// return;
// }
// }
let fileObj = file.raw
this.formData1.set('file', fileObj)
},

2
src/views/super/clientSet/headerPage.vue

@ -2,7 +2,7 @@
<div class="mainTextPage main-content12">
<h3 class="pageTitle">页眉页码</h3>
<div class="flex-between flex-common" id="headerOne">
<ClientForm ref="oneLevelRef" title="页眉" :init-data="oneFormData" :outputStructure="['page_number','content']"
<ClientForm ref="oneLevelRef" v-if="false" title="页眉" :init-data="oneFormData" :outputStructure="['page_number','content']"
:fontDetailflag="true" :showIndentation="false" :fontWeightflag="false" @cancel="(data) => handleCancelEvent(data, 'oneLevel')"
@submit="(data) => handleSubmitEvent(data, 'oneLevel')" />
<ClientForm ref="twoLevelRef" title="页码" :fontDetailflag="true" :lineSpaceShow="false" :showIndentation="false"

58
src/views/super/clientSet/mainTextPage.vue

@ -92,6 +92,32 @@ export default {
mounted() {
},
methods: {
getOutputStructure(refName) {
const structureMap = {
'level_1_heading': ['title', 'content', 'level_1_heading'],
'level_2_heading': ['title', 'content', 'level_2_heading'],
'level_3_heading': ['title', 'content', 'level_3_heading'],
'mainRef': ['text', 'content'],
'tableRef': ['table', 'title'],
'imagesRef': ['image', 'title']
};
return structureMap[refName] || [];
},
forceFormReset(refName) {
//
this.formKey = Date.now();
// Vue
this.$nextTick(() => {
//
const ref = this.$refs[refName];
if (ref) {
// setFormData
const newData = this.getDynamicDataSafe(this.getOutputStructure(refName));
ref.setFormData(newData);
}
});
},
getDynamicDataSafe(outputStructure) {
if (!Array.isArray(outputStructure) || outputStructure.length === 0) {
return {};
@ -104,33 +130,15 @@ export default {
return result || {};
},
//
handleCancelEvent(formData, refName) {
console.log('外部重置方法:', formData);
// refName
switch (refName) {
case 'level_1_heading':
console.log('执行一级标题重置逻辑');
// ref
this.$refs[refName + 'Ref']?.someMethod();
break;
case 'level_2_heading':
console.log('执行二级标题重置逻辑');
break;
case 'level_3_heading':
console.log('执行三级标题重置逻辑');
break;
case 'main':
console.log('执行正文内容重置逻辑');
break;
case 'table':
console.log('执行表格标题重置逻辑');
break;
case 'images':
console.log('执行图片标题重置逻辑');
break;
default:
console.log('默认重置逻辑');
// store
if (this.client_tpl_type === 'edit') {
this.forceFormReset(refName);
} else {
//
}
},

77
src/views/super/clientSet/summaryPage.vue

@ -2,32 +2,22 @@
<div class="mainTextPage main-content12">
<h3 class="pageTitle">摘要</h3>
<div class="flex-between flex-common" id="summaryTitle">
<ClientForm ref="chTitleRef" title="中文摘要标题" :init-data="chTitleData" :titlePosFlag="false"
getDynamicDataSafe @cancel="(data) => handleCancelEvent(data, 'chTitleRef')"
<ClientForm ref="chTitleRef" title="摘要标题" :init-data="chTitleData" :titlePosFlag="false"
@cancel="(data) => handleCancelEvent(data, 'chTitleRef')"
:outputStructure="chTitleOut"
@submit="(data) => handleSubmitEvent(data, 'chTitleRef')" />
<ClientForm ref="engTitleRef" title="英文摘要标题" :titlePosFlag="false" getDynamicDataSafe
:init-data="engTitleData" @cancel="(data) => handleCancelEvent(data, 'engTitleRef')"
:outputStructure="engTitleOut"
@submit="(data) => handleSubmitEvent(data, 'engTitleRef')" />
</div>
<div class="flex-between flex-common mt12" id="summaryContent">
<ClientForm ref="chTextRef" title="中文摘要正文" :titlePosFlag="false" getDynamicDataSafe
<ClientForm ref="chTextRef" title="摘要正文" :titlePosFlag="false"
:init-data="chTextData" @cancel="(data) => handleCancelEvent(data, 'chTextRef')"
:outputStructure="chTextOut"
@submit="(data) => handleSubmitEvent(data, 'chTextRef')" />
<ClientForm ref="engTextRef" title="英文摘要正文" :titlePosFlag="false" getDynamicDataSafe
:init-data="engTextData" @cancel="(data) => handleCancelEvent(data, 'engTextRef')"
:outputStructure="engTextOut"
@submit="(data) => handleSubmitEvent(data, 'engTextRef')" />
</div>
<div class="flex-between flex-common mt12" id="summaryKeyWords">
<ClientForm ref="chKeyRef" title="中文关键词" :titlePosFlag="false" getDynamicDataSafe
<div class="flex-between flex-common mt12" id="summaryContent">
<ClientForm ref="chKeyRef" title="中文关键词" :titlePosFlag="false" :lineSpaceShow="false"
:ch_keywords="true" :showIndentation="false" :outputStructure="chKeyOut" :alignShow="false"
:init-data="chKeyData" @cancel="(data) => handleCancelEvent(data, 'chKeyRef')"
@submit="(data) => handleSubmitEvent(data, 'chKeyRef')" />
<ClientForm ref="engKeyRef" title="英文关键词" :titlePosFlag="false" getDynamicDataSafe
:eng_keywords="true" :showIndentation="false" :outputStructure="engKeyOut" :alignShow="false"
<ClientForm ref="engKeyRef" title="" :titlePosFlag="false"
:eng_keywords="true" :showIndentation="false" :outputStructure="chKeyOut" :alignShow="false"
:init-data="engKeyData" @cancel="(data) => handleCancelEvent(data, 'engKeyRef')"
@submit="(data) => handleSubmitEvent(data, 'engKeyRef')" />
</div>
@ -47,51 +37,12 @@ export default {
data() {
return {
chTitleOut:['abstract','title'],
engTitleOut:['abstract','title'],
chTextOut:['abstract','content'],
engTextOut:['abstract','content'],
chKeyOut:['abstract','title'],
engKeyOut:['abstract','title'],
// chTitleData: {
// fontSize: '12',
// align: 1,
// indentation: '0'
// },
// engTitleData: {
// fontSize: '12',
// ch_font:1,
// align: 1,
// indentation: '0'
// },
// chTextData: {
// fontSize: '12',
// ch_font:1,
// align: 1,
// indentation: '1'
// },
// engTextData: {
// fontSize: '12',
// ch_font:1,
// align: 1,
// indentation: '1'
// },
// chKeyData: {
// fontSize: '12',
// ch_font:1,
// align: 1,
// bold:0
// },
// engKeyData: {
// fontSize: '12',
// ch_font:1,
// align: 1,
// bold:0
// },
chKeyOut:['keywords','title'],
engKeyOut:['keywords','content'],
};
},
mounted() {
// this.getSummaryInfo();
},
computed: {
...mapState(['client_tpl_review_status','client_tpl_type','client_tpl_id','client_tpl_config']),
@ -100,20 +51,10 @@ export default {
return this.getDynamicDataSafe(this.chTitleOut);
},
engTitleData() {
return this.getDynamicDataSafe(this.engTitleOut);
},
//
chTextData() {
return this.getDynamicDataSafe(this.chTextOut);
},
//
engTextData() {
return this.getDynamicDataSafe(this.engTextOut);
},
//
chKeyData() {
return this.getDynamicDataSafe(this.chKeyOut) || {};

100
src/views/super/paiban/college.vue

@ -26,23 +26,25 @@
<GuipTable :tableData="tableList" :key="tableKey" ref="multipleTable" autoColumn="true" :loading="tableLoading" style="flex:1">
<template>
<el-table-column fixed="left" prop="school_name" label="学校" min-width="200"></el-table-column>
<el-table-column prop="degree_name" label="学历" min-width="200"></el-table-column>
<el-table-column prop="college_name" label="学院" min-width="200"></el-table-column>
<el-table-column prop="degree_name" label="学历" min-width="100"></el-table-column>
<el-table-column prop="college_name" label="学院" min-width="200">
<template slot-scope="scope">
{{ scope.row.college_name != '-1' ? scope.row.college_name : '通用' }}
</template>
</el-table-column>
<el-table-column prop="phone" label="反馈用户手机号" min-width="200"></el-table-column>
<el-table-column prop="review_status_desc" label="要求" min-width="200">
<el-table-column prop="review_status_desc" label="要求" min-width="60">
<template slot-scope="scope">
<svg-icon :path="require('@/assets/register/tableEdit.svg')" :color="'#8A9099'" @click="handleLunwen(scope.row.id,'0')"
:hoverColor="'#006AFF'" />
<img src="@/assets/order_down.svg" @click="downLunwen(scope.row.id,'0')" alt="">
</template>
</el-table-column>
<el-table-column prop="review_status_desc" label="论文" min-width="200">
<el-table-column prop="review_status_desc" label="论文" min-width="60">
<template slot-scope="scope">
<SvgIcon :path="require('@/assets/register/tableEdit.svg')" @click="handleLunwen(scope.row.id,'1')" :color="'#8A9099'"
:hoverColor="'#006AFF'" />
<img src="@/assets/order_down.svg" @click="downLunwen(scope.row.id,'1')" alt="">
</template>
</el-table-column>
<el-table-column prop="review_status_desc" label="上传时间" min-width="200"></el-table-column>
<el-table-column prop="status" label="状态" min-width="200">
<el-table-column prop="status" label="状态" min-width="120">
<template slot-scope="scope">
<span :class="['status','status'+[scope.row.review_status]]">{{ scope.row.review_status_desc }}</span>
</template>
@ -81,7 +83,7 @@
</template>
<script>
import SvgIcon from '@/components/SvgIcon.vue';
// import SvgIcon from '@/components/SvgIcon.vue';
import GuipButton from "@/components/GuipButton.vue";
import GuipTable from "@/components/GuipTable.vue";
import GuipSelect from "@/components/GuipSelect.vue";
@ -107,7 +109,6 @@ export default {
GuipSelect,
GuipTable,
GuipButton,
SvgIcon,
SchoolAutoComplete,
GuipFormItem
},
@ -259,33 +260,7 @@ export default {
query: { id:row.id }
})
},
handleLunwen(id,type){
// this.refuse_id = row.id
let url = '/supernew/down_paiban_template_require?template_id='
if(type == 1){
url = '/supernew/down_paiban_template_paper?template_id='
}
window.open(url+id)
try {
this.$http('GET', url+id, {
}).then(response => {
this.$nextTick(() => {
if (response.status) {
this.$Message.success(response.info);
} else {
this.$Message.error(response.info);
}
})
}).catch(error => {
console.error(error, 'error')
})
} catch (error) {
console.error('数据加载失败:', error)
}
},
handleRefuse(row){
this.isShowDialog = true
this.refuse_id = row.id
@ -300,6 +275,55 @@ export default {
handleConfirmRefuse(){
this.handleConfirm(this.refuse_id,'')
},
downLunwen(id,type){
console.log(id);
let url = '/supernew/down_paiban_template_require?template_id='
if(type == 1){
url = '/supernew/down_paiban_template_paper?template_id='
}
try {
this.$http('GET', url+id, {},{
returnFullResponse: true,
responseType: 'blob'
}).then(response => {
const {
headers, // headers
data, //
} = response;
const filename = this.decodeRFC5987Filename(headers['content-disposition']);
console.log(headers,data,filename,'ajax_get_check_order_list=====');
const blob = new Blob([data], { type: 'application/force-download' });
const downloadUrl = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = downloadUrl;
link.setAttribute('download', filename);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
window.URL.revokeObjectURL(downloadUrl);
this.$Message.success('下载成功');
}).catch(error => {
this.$Message.info('下载失败' || error);
})
} catch (error) {
this.$Message.info('下载失败');
}
},
decodeRFC5987Filename(header) {
const match = header.match(/filename\*=(?:utf8|UTF-8)''([^;]+)/i);
console.log(match, 'match');
if (match) {
return decodeURIComponent(match[1]);
}
// 退 filename="xxx"
const fallbackMatch = header.match(/filename="?([^"]+)"?/i);
return fallbackMatch ? fallbackMatch[1] : 'download';
},
}
}

106
src/views/super/paiban/orderlist.vue

@ -5,9 +5,9 @@
<div class="flex-between filter-area">
<label for="">订单管理</label>
<div class="flex gap12">
<GuipSelect ref="GuipSelect" label="订单状态" placeholder="请选择订单状态" v-model="status"/>
<GuipSelect ref="GuipSelect" v-if="false" label="订单状态" placeholder="请选择订单状态" v-model="status"/>
<GuipInput ref="GuipInput" label="订单号" placeholder="请输入订单号" v-model="orderId" width="280px"/>
<GuipButton type="system">搜索</GuipButton>
<GuipButton type="system" @click="searchOrderId">搜索</GuipButton>
</div>
</div>
<GuipTable :tableData="tableList" :key="tableKey" ref="multipleTable" autoColumn="true" :loading="tableLoading" style="flex:1">
@ -80,9 +80,9 @@
<el-table-column fixed="right" prop="tid" label="操作" min-width="280">
<template slot-scope="scope">
<div class="flex gap12">
<span class="resetBtn" @click="handleShowInfo(scope.row.tid)">重新提取</span>
<span class="resetBtn" @click="handleShowInfo(scope.row.tid)">重新排版</span>
<GuipButton type="text" @click="downLoadInfo(scope.row.tid)">下载</GuipButton>
<span class="resetBtn" @click="handleShowInfo(scope.row.id,'0')">重新提取</span>
<span class="resetBtn" @click="handleShowInfo(scope.row.id,'1')">重新排版</span>
<GuipButton type="text" @click="downLoadInfo(scope.row.id)">下载</GuipButton>
</div>
</template>
</el-table-column>
@ -91,6 +91,7 @@
<el-pagination background @size-change='handleSizeChange' @current-change='handleCurrentChange'
:current-page="currentPage" :page-size=pageSize layout="prev, pager, next,jumper" :total="parseInt(total)">
</el-pagination>
<a href="" style="display: none;"></a>
</el-form>
</div>
</div>
@ -152,11 +153,14 @@ export default {
return ''
}
},
getList() {
searchOrderId(){
this.getList({orderid:this.orderId})
},
getList(props={}) {
//api
try {
this.$http('POST', 'supernew/ajax_get_paiban_list', {
// orderId: this.orderId,
...props,
page: this.currentPage,
pagesize: this.pageSize
}).then(response => {
@ -172,37 +176,65 @@ export default {
}
},
downLunwen(id){
console.log(id);
try {
this.$http('GET', `supernew/down_paiban_template_paper?template_id=${id}`, {
},{
headers: {
'Content-Type':'multipart/form-data'
}
this.$http('GET', `supernew/down_paiban_template_paper?template_id=${id}`, {},{
returnFullResponse: true,
responseType: 'blob'
}).then(response => {
console.log(response,'===000');
const {
headers, // headers
data, //
} = response;
const filename = this.decodeRFC5987Filename(headers['content-disposition']);
console.log(headers,data,filename,'ajax_get_check_order_list=====');
const blob = new Blob([data], { type: 'application/force-download' });
const downloadUrl = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = downloadUrl;
link.setAttribute('download', filename);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
window.URL.revokeObjectURL(downloadUrl);
}).catch(error => {
console.error(error, 'error')
})
} catch (error) {
console.error('数据加载失败:', error)
}
},
downLoadInfo(tid){
try {
this.$http('POST', '/supernew/down_paiban_template_require', {
template_id:tid
}).then(response => {
this.$nextTick(() => {
this.tableList = response.data.list
this.total = response.data.count
})
}).catch(error => {
console.error(error, 'error')
})
} catch (error) {
console.error('数据加载')
decodeRFC5987Filename(header) {
const match = header.match(/filename\*=(?:utf8|UTF-8)''([^;]+)/i);
console.log(match, 'match');
if (match) {
return decodeURIComponent(match[1]);
}
// 退 filename="xxx"
const fallbackMatch = header.match(/filename="?([^"]+)"?/i);
return fallbackMatch ? fallbackMatch[1] : 'download';
},
downLoadInfo(tid){
console.log(tid);
// try {
// this.$http('POST', '/supernew/down_paiban_template_require', {
// template_id:tid
// }).then(response => {
// this.$nextTick(() => {
// this.tableList = response.data.list
// this.total = response.data.count
// })
// }).catch(error => {
// console.error(error, 'error')
// })
// } catch (error) {
// console.error('')
// }
},
handleSizeChange(val) {
this.pageSize = val
@ -212,20 +244,20 @@ export default {
this.currentPage = val
this.getList()
},
handleShowInfo(tid) {
handleShowInfo(id,status) {
try {
this.$http('POST', '/supernew/down_paiban_template_require', {
template_id:tid
this.$http('POST', '/supernew/ajax_update_paiban_status', {
paiban_id:id,
status:status
}).then(response => {
this.$nextTick(() => {
this.tableList = response.data.list
this.total = response.data.count
})
if(response.status){
this.$Message.success('操作成功')
}
}).catch(error => {
console.error(error, 'error')
this.$Message.success(error || '操作失败')
})
} catch (error) {
console.error('数据加载失败:', error)
this.$Message.success(error || '失败')
}
}
}

2
src/views/super/paiban/tpl.vue

@ -44,7 +44,7 @@
<el-table-column fixed="left" prop="school_name" label="学校" min-width="200"></el-table-column>
<el-table-column prop="degree_name" label="学历" min-width="200"></el-table-column>
<el-table-column prop="college_name" label="学院" min-width="200"></el-table-column>
<el-table-column prop="status_desc" label="更新时间" min-width="200"></el-table-column>
<el-table-column prop="last_updated_time" label="更新时间" min-width="200"></el-table-column>
<el-table-column prop="status" label="状态" min-width="200">
<template slot-scope="scope">
<span :class="['status','status'+[scope.row.status]]">{{ scope.row.status_desc }}</span>

Loading…
Cancel
Save