Browse Source

增加模板页面交互、配置选项接口

clientSet-zq-1128
zq 1 week ago
parent
commit
3511f336bc
  1. 26
      src/components/clientSet/clientForm.vue
  2. 63
      src/components/clientSet/reviewBtn.vue
  3. 136
      src/store/index.js
  4. 15
      src/views/super/clientSet/catalogPage.vue
  5. 124
      src/views/super/clientSet/coverInfoPage.vue
  6. 9
      src/views/super/clientSet/headerPage.vue
  7. 15
      src/views/super/clientSet/mainTextPage.vue
  8. 10
      src/views/super/clientSet/referencePage.vue
  9. 8
      src/views/super/clientSet/summaryPage.vue
  10. 9
      src/views/super/clientSet/switchPage.vue
  11. 11
      src/views/super/clientSet/thanksPage.vue
  12. 32
      src/views/super/paiban/college.vue

26
src/components/clientSet/clientForm.vue

@ -107,17 +107,19 @@
</div>
</div>
<GroupFormBtns cancelText="重置" @cancel="cancelClick" flex="start" @confirm="submitDoctorBaseInfo" />
</el-form>
</div>
</template>
<script>
import store from '@/store';
// import { mapState } from 'vuex';
import GuipInput from '@/components/GuipInput.vue';
import GroupFormBtns from '@/components/GroupFormBtns.vue';
import GuipRadio from '@/components/GuipRadio.vue';
import GuipSelect from '@/components/GuipSelect.vue';
import { mapState } from 'vuex';
export default {
name: 'CoverInfoPage',
@ -203,6 +205,7 @@ export default {
},
data() {
return {
optionsList:{},
coverInfo: {
lineSpaceUnit: '',//
lineSpace: '',//
@ -285,6 +288,7 @@ export default {
};
},
computed: {
...mapState(['client_tpl_options']),
// 使
alignList() {
return this.alignOptions.length > 0 ? this.alignOptions : this.internalAlignList;
@ -318,7 +322,27 @@ export default {
deep: true
},
},
async mounted() {
//
if (!store.getters.hasPaibanLoaded) {
console.log('=1');
await store.dispatch('fetchPaibanTemplateOption');
}
console.log(this.client_tpl_options,'client_tpl_options');
},
methods: {
// getOptionsList() {
// try {
// this.$http('POST', 'supernew/ajax_get_paiban_template_option', {
// }).then(response => {
// this.optionsList = response.data;
// }).catch(error => {
// console.error(error, 'error')
// })
// } catch (error) {
// console.error(':', error)
// }
// },
checkGrammar(e) {
//
// const reg = /[\u4e00-\u9fa5]/;

63
src/components/clientSet/reviewBtn.vue

@ -0,0 +1,63 @@
<template>
<div class="save-button column gap8" v-if="type == 'add' || client_tpl_review_status == '1'">
<GuipButton type="primary" :btnstyle="{width:'144px',height:'46px'}" @click="submitFun">收录完成</GuipButton>
<p class="client-warnText">信息全部填写后请点击此按钮</p>
</div>
</template>
<script>
import { mapState } from 'vuex';
import GuipButton from '@/components/GuipButton.vue';
export default {
components: {
GuipButton,
},
computed: {
...mapState(['client_tpl_review_status','client_tpl_type','client_tpl_id']),
},
watch: {
client_tpl_id: {
handler(newVal, oldVal) {
console.log('client_tpl_id 变化:',oldVal, newVal);
},
immediate: true, // 使
deep: false // deep
}
},
props:['type','status'],
mounted() {
console.log(this.client_tpl_id,'client_tpl_id====');
},
methods:{
submitFun(){
// this.$emit('submit')
//
try {
this.$http('POST', '/supernew/ajax_update_paiban_template_review_status', {
template_id: this.client_tpl_id,
review_status: '2',
refuse_reason:''
}).then(response => {
this.$nextTick(() => {
if (response.status) {
this.$Message.success(response.info);
if(this.client_tpl_type == 'add'){
this.$router.push({path: '/client/paiban/tpl'})
}else{
this.$router.push({path: '/client/paiban/college'})
}
} else {
this.$Message.error(response.info);
}
})
}).catch(error => {
console.error(error, 'error')
})
} catch (error) {
console.error('数据加载失败:', error)
}
}
}
}
</script>

136
src/store/index.js

@ -24,6 +24,17 @@ export default new Vuex.Store({
carryParam: true, //携带参数
componentsName: '',
currentMenuItem: null,
client_tpl_id: '',//排版-模板id
client_tpl_type: '',//排版-模板类型 编辑还是添加 还是从收录进来的 edit add collect
client_tpl_review_status: '',//排版-模板收录状态
client_tpl_options:{},//排版-模板选项
client_tpl_config:{},//排版-模板选项
paibanRequestStatus: {
isLoading: false,
hasLoaded: false,
lastRequestTime: 0,
cacheDuration: 5 * 60 * 1000 // 5分钟缓存
},
uiSliderData: [
{
name: 'UI组件库示例',
@ -814,6 +825,98 @@ export default new Vuex.Store({
},
actions: {
async fetchClientOptions({ commit }) {
try {
// 使用 axios 或您项目中的 http 库
Vue.prototype.$http('POST', '/supernew/ajax_get_paiban_template_option', {
}).then(response => {
// this.qualificationList = response.data
// 将数据存储到 client_tpl_options 中
commit('SET_CLIENT_TPL_OPTIONS', {
...response.data,
});
}).catch(error => {
console.error(error, 'error')
})
// return response.data;
} catch (error) {
console.error('获取学位数据失败:', error);
throw error;
}
},
async fetchPaibanTemplateOption({ state, commit }) {
// 如果正在加载中,直接返回
if (state.paibanRequestStatus.isLoading) {
return new Promise((resolve) => {
// 等待现有请求完成
const interval = setInterval(() => {
if (!state.paibanRequestStatus.isLoading) {
clearInterval(interval);
resolve(state.client_tpl_options);
}
}, 100);
});
}
// 如果有缓存且在有效期内,直接使用缓存
const now = Date.now();
if (state.paibanRequestStatus.hasLoaded &&
(now - state.paibanRequestStatus.lastRequestTime) < state.paibanRequestStatus.cacheDuration) {
return state.client_tpl_options;
}
// 开始请求
try {
commit('SET_REQUEST_LOADING', true);
let data = {}
// const response = await this._vm.$http('POST', '/supernew/ajax_get_paiban_template_option', {});
Vue.prototype.$http('POST', '/supernew/ajax_get_paiban_degrees', {
}).then(response => {
// 存储数据
data=response.data
commit('SET_CLIENT_TPL_OPTIONS', response.data);
commit('SET_REQUEST_STATUS', {
hasLoaded: true,
lastRequestTime: now
});
}).catch(error => {
console.error(error, 'error')
})
return data;
} catch (error) {
console.error('获取排版选项失败:', error);
commit('SET_REQUEST_ERROR', error);
throw error;
} finally {
commit('SET_REQUEST_LOADING', false);
}
},
// 强制刷新(忽略缓存)
forceFetchPaibanTemplateOption({ commit,dispatch }) {
commit('SET_REQUEST_STATUS', {
hasLoaded: false,
lastRequestTime: 0
});
return dispatch('fetchPaibanTemplateOption');
},
SET_CLIENTTEMID({
commit
}) {
commit('SET_CLIENTTEMID');
},
SET_CLIENTTPLREVIEWSTATUS({
commit
}) {
commit('SET_CLIENTTPLREVIEWSTATUS');
},
SET_CLIENTTEMTYPE({
commit
}) {
commit('SET_CLIENTTEMTYPE');
},
SET_HEADER({
commit
}) {
@ -896,8 +999,25 @@ export default new Vuex.Store({
},
},
mutations: {
SET_CLIENT_TPL_OPTIONS(state, data) {
state.client_tpl_options = data;
},
SET_REQUEST_LOADING(state, isLoading) {
state.paibanRequestStatus.isLoading = isLoading;
},
SET_REQUEST_STATUS(state, status) {
state.paibanRequestStatus = {
...state.paibanRequestStatus,
...status
};
},
SET_REQUEST_ERROR(state, error) {
state.paibanRequestStatus.error = error;
},
SET_CURRENTMENUITEM(state, data) {
// console.log(data,'=====data====currentMenuItem');
state.currentMenuItem = data && JSON.parse(JSON.stringify(data));
},
SET_COMPONENTS_NAME(state, name) {
@ -939,6 +1059,15 @@ export default new Vuex.Store({
SET_HEADER(state, show) {
state.showHeader = show;
},
SET_CLIENTTEMTYPE(state, show) {
state.client_tpl_type = show;
},
SET_CLIENTTEMID(state, show) {
state.client_tpl_id = show;
},
SET_CLIENTTPLREVIEWSTATUS(state, show) {
state.client_tpl_review_status = show;
},
SET_HEADER_RIGHT(state, show) {
state.showHeaderRight = show;
},
@ -957,7 +1086,10 @@ export default new Vuex.Store({
}
},
getters: {
menuData: state => state.menuData
menuData: state => state.menuData,
getClientTplOptions: state => state.client_tpl_options,
isPaibanLoading: state => state.paibanRequestStatus.isLoading,
hasPaibanLoaded: state => state.paibanRequestStatus.hasLoaded
},
// plugins: [createPersistedState()],
modules: {}

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

@ -14,18 +14,21 @@
:init-data="threeFormData" @cancel="(data) => handleCancelEvent(data, 'threeLevelRef')"
@submit="(data) => handleSubmitEvent(data, 'threeLevelRef')" />
</div>
<div class="save-button flex">
<GuipButton type="primary" :btnstyle="{width:'144px',height:'46px'}" @click="submitFun">收录完成</GuipButton>
</div>
<ReviewBtn ></ReviewBtn>
</div>
</template>
<script>
import GuipButton from '@/components/GuipButton.vue';
import { mapState } from 'vuex';
import ReviewBtn from '@/components/clientSet/reviewBtn.vue';
import ClientForm from '@/components/clientSet/clientForm.vue';
export default {
components: {
ClientForm,
GuipButton
ReviewBtn
},
computed: {
...mapState(['client_tpl_review_status']),
},
data() {
return {
@ -56,9 +59,11 @@ export default {
},
mounted() {
// this.getCataInfo();
},
methods: {
submitFun() {
this.$router.push({
path: '/super/paiban/tpl',
})

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

@ -18,8 +18,8 @@
/>
</div>
<!-- <GuipInput v-model="coverInfo.school" :client-form-flex="true" label="所属学校" width="356px" /> -->
<GuipRadio :options="collegeList" v-model="coverInfo.collegeId" :client-form-flex="true" label="学院" />
<GuipInput v-if="coverInfo.collegeId == '1'" v-model="coverInfo.college" label="学院名称" :client-form-flex="true" width="356px" />
<GuipRadio :options="collegeList" v-model="coverInfo.college_id" :client-form-flex="true" label="学院" />
<GuipInput v-if="coverInfo.college_id == '1'" v-model="coverInfo.college" label="学院名称" :client-form-flex="true" width="356px" />
<GuipRadio :options="qualificationList" v-model="coverInfo.degree" label="学历" :client-form-flex="true" />
<GroupFormBtns cancelText="重置" @cancel="cancelClick('baseInfoRef')" flex="start"
@confirm="submitCoverInfo" />
@ -45,20 +45,17 @@
<GroupFormBtns cancelText="重置" @cancel="cancelClick('siteForm')" flex="start"
@confirm="uploadCoverTpl" />
</div>
<div class="save-button column gap8" v-if="type == 'add' || editInfo.review_status == '1'">
<GuipButton type="primary" :btnstyle="{width:'144px',height:'46px'}" @click="submitFun">收录完成</GuipButton>
<p class="client-warnText">信息全部填写后请点击此按钮</p>
</div>
<ReviewBtn :type="type" :status="editInfo.review_status"></ReviewBtn>
</div>
</template>
<script>
// client_tpl_review_status
import store from '@/store';
// import { mapState } from 'vuex';
import { mapState } from 'vuex';
import GuipInput from '@/components/GuipInput.vue';
import GroupFormBtns from '@/components/GroupFormBtns.vue';
import GuipRadio from '@/components/GuipRadio.vue';
import GuipButton from '@/components/GuipButton.vue';
import ReviewBtn from '@/components/clientSet/reviewBtn.vue';
// import GuipSelect from '@/components/GuipSelect.vue';
import SchoolAutoComplete from '@/components/clientSet/searchInput.vue'; //
@ -69,7 +66,8 @@ export default {
GuipInput,
GuipRadio,
GuipButton,
SchoolAutoComplete
SchoolAutoComplete,
ReviewBtn
// GuipSelect
},
data() {
@ -80,7 +78,8 @@ export default {
qrcode_path: ''
},
coverInfo: {
school_name:''
school_name:'',
college:''
},
rules: {
name: [
@ -106,6 +105,9 @@ export default {
lastSearchKeyword:'',
};
},
computed: {
...mapState(['client_tpl_review_status']),
},
mounted() {
const {id,type} = this.$route.query;
if(type){
@ -114,6 +116,9 @@ export default {
if(id){
this.template_id = id;
}
if(type == 'add'){
store.commit('SET_CLIENTTPLREVIEWSTATUS', 1);
}
store.commit('SET_CLIENTTEMID', this.template_id);
store.commit('SET_CLIENTTEMTYPE', this.type);
@ -123,7 +128,7 @@ export default {
this.coverInfo = {
school:editInfo.school_id,
school_name:editInfo.school_name,
collegeId:editInfo.college_id,
college_id:editInfo.college_id,
college:editInfo.college_name,
degree:editInfo.degree_id,
// qrcode_path:editInfo.cover_img
@ -132,7 +137,7 @@ export default {
}
this.getCoverInfo();
this.getStatusList() //
this.getStatusList()
},
methods: {
@ -148,25 +153,26 @@ export default {
},
async getCoverInfo(){
// this.$http('POST', '/supernew/ajax_get_paiban_template_list', {}, {
// }).then(response => {
// console.log(response,'=======999');
// this.$nextTick(() => {
// if (response.status) {
// this.$Message.success(response.info);
// } else {
// this.$Message.error(response.info);
// }
// })
// }).catch(error => {
// console.error(error, 'error')
// })
this.$http('POST', '/supernew/ajax_get_paiban_template_config', {
template_id:'14'
}).then(response => {
console.log(response,'=======999');
this.$nextTick(() => {
if (response.status) {
this.$Message.success(response.info);
} else {
this.$Message.error(response.info);
}
})
}).catch(error => {
console.error(error, 'error')
})
},
getStatusList() {
try {
this.$http('POST', '/supernew/ajax_get_paiban_degrees', {
}).then(response => {
this.qualificationList = response.data
this.qualificationList = response.data
}).catch(error => {
console.error(error, 'error')
})
@ -175,6 +181,7 @@ export default {
}
},
cancelClick(formName) {
this.$refs[formName].resetFields();
},
@ -240,44 +247,51 @@ export default {
handleConfirmConfirm(){
let props={
school: this.coverInfo.school,
college: this.coverInfo.collegeId == '1' ? this.editInfo.college_name : '-1',
college: this.coverInfo.college_id == '1' ? this.editInfo.college_name : '',
degree: this.coverInfo.degree,
}
let url = '/supernew/ajax_add_paiban_template'
// let url = '/supernew/ajax_add_paiban_template'
if(this.template_id){
props.template_id = this.template_id;
url ='/supernew/ajax_update_paiban_template_info'
// url ='/supernew/ajax_update_paiban_template_info'
}
if(this.coverInfo.school){
props.school = this.coverInfo.school;
}
try {
this.$http('POST', url, {
...props,
}).then(response => {
this.$nextTick(() => {
if (response.status) {
this.$Message.success(response.info);
if(props.template_id){
let obj = {
...this.editInfo,
...props,
};
localStorage.setItem('curtplInfo', JSON.stringify(obj))
}
this.template_id = response.data.template_id
store.commit('SET_CLIENTTEMID', this.template_id);
//
// localStorage.setItem('curtplInfo', JSON.stringify({...this.coverInfo,degree_id:this.coverInfo.degree}))
// store.commit('SET_CLIENTTEMID', '999');
} else {
this.$Message.error(response.info);
}
})
}).catch(error => {
console.error(error, 'error')
})
} catch (error) {
console.error('数据加载失败:', error)
}
// try {
// this.$http('POST', url, {
// ...props,
// }).then(response => {
// this.$nextTick(() => {
// if (response.status) {
// this.$Message.success(response.info);
// if(props.template_id){
// let obj = {
// ...this.editInfo,
// ...props,
// };
// localStorage.setItem('curtplInfo', JSON.stringify(obj))
// }else{
// console.log(this.coverInfo,'coverInfo');
// localStorage.setItem('curtplInfo', JSON.stringify({...this.coverInfo,degree_id:this.coverInfo.degree}))
// }
// this.template_id = response.data.template_id
// store.commit('SET_CLIENTTEMID', this.template_id);
// } else {
// this.$Message.error(response.info);
// }
// })
// }).catch(error => {
// console.error(error, 'error')
// })
// } catch (error) {
// console.error(':', error)
// }
},
//
submitFun() {

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

@ -9,19 +9,18 @@
:init-data="twoFormData" @cancel="(data) => handleCancelEvent(data, 'twoLevel')"
@submit="(data) => handleSubmitEvent(data, 'twoLevel')" />
</div>
<div class="save-button flex">
<GuipButton type="primary" :btnstyle="{width:'144px',height:'46px'}" @click="submitFun">收录完成</GuipButton>
</div>
<ReviewBtn ></ReviewBtn>
</div>
</template>
<script>
import ClientForm from '@/components/clientSet/clientForm.vue';
import GuipButton from '@/components/GuipButton.vue';
import ReviewBtn from '@/components/clientSet/reviewBtn.vue';
export default {
components: {
ClientForm,
GuipButton
ReviewBtn
},
data() {
return {

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

@ -27,19 +27,18 @@
@cancel="(data) => handleCancelEvent(data, 'imagesRef')"
@submit="(data) => handleSubmitEvent(data, 'imagesRef')" />
</div>
<div class="save-button flex">
<GuipButton type="primary" :btnstyle="{width:'144px',height:'46px'}" @click="submitFun">收录完成</GuipButton>
</div>
<ReviewBtn ></ReviewBtn>
</div>
</template>
<script>
import ClientForm from '@/components/clientSet/clientForm.vue';
import GuipButton from '@/components/GuipButton.vue';
import ReviewBtn from '@/components/clientSet/reviewBtn.vue';
import { mapState } from 'vuex';
export default {
components: {
ClientForm,
GuipButton
ReviewBtn
},
data() {
return {
@ -81,8 +80,12 @@ export default {
},
};
},
computed: {
...mapState(['client_tpl_review_status','client_tpl_type']),
},
mounted() {
// this.getMainInfo();
console.log(this.client_tpl_type,'=this.client_tpl_type===');
},
methods: {
submitFun() {

10
src/views/super/clientSet/referencePage.vue

@ -9,19 +9,16 @@
:init-data="referenceTextData" @cancel="(data) => handleCancelEvent(data, 'referenceTextRef')"
@submit="(data) => handleSubmitEvent(data, 'referenceTextRef')" />
</div>
<div class="save-button flex">
<GuipButton type="primary" :btnstyle="{width:'144px',height:'46px'}" @click="submitFun">收录完成</GuipButton>
</div>
<ReviewBtn ></ReviewBtn>
</div>
</template>
<script>
import GuipButton from '@/components/GuipButton.vue';
import ReviewBtn from '@/components/clientSet/reviewBtn.vue';
import ClientForm from '@/components/clientSet/clientForm.vue';
export default {
components: {
ClientForm,
GuipButton
ReviewBtn
},
data() {
return {
@ -42,6 +39,7 @@ export default {
},
methods: {
submitFun() {
//
this.$router.push({
path: '/super/paiban/tpl',
})

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

@ -27,18 +27,16 @@
:init-data="engKeyData" @cancel="(data) => handleCancelEvent(data, 'engKeyRef')"
@submit="(data) => handleSubmitEvent(data, 'engKeyRef')" />
</div>
<div class="save-button flex">
<GuipButton type="primary" :btnstyle="{width:'144px',height:'46px'}" @click="submitFun">收录完成</GuipButton>
</div>
<ReviewBtn ></ReviewBtn>
</div>
</template>
<script>
import GuipButton from '@/components/GuipButton.vue';
import ReviewBtn from '@/components/clientSet/reviewBtn.vue';
import ClientForm from '@/components/clientSet/clientForm.vue';
export default {
components: {
ClientForm,
GuipButton
ReviewBtn
},
data() {
return {

9
src/views/super/clientSet/switchPage.vue

@ -14,18 +14,16 @@
</div>
</el-form>
</div>
<div class="save-button flex">
<GuipButton type="primary" :btnstyle="{width:'144px',height:'46px'}" @click="submitFun">收录完成</GuipButton>
</div>
<ReviewBtn ></ReviewBtn>
</div>
</template>
<script>
import GuipButton from '@/components/GuipButton.vue';
import ReviewBtn from '@/components/clientSet/reviewBtn.vue';
import GuipSwitch from '@/components/GuipSwitch.vue';
export default {
components: {
GuipSwitch,
GuipButton
ReviewBtn
},
data() {
return {
@ -34,6 +32,7 @@ export default {
},
mounted() {
// this.getSwitchInfo();
},
methods: {
submitFun() {

11
src/views/super/clientSet/thanksPage.vue

@ -10,18 +10,18 @@
:init-data="thanksTextFormData" @cancel="(data) => handleCancelEvent(data, 'thanksText')"
@submit="(data) => handleSubmitEvent(data, 'thanksText')" />
</div>
<div class="save-button flex">
<GuipButton type="primary" :btnstyle="{width:'144px',height:'46px'}" @click="submitFun">收录完成</GuipButton>
</div>
<ReviewBtn ></ReviewBtn>
</div>
</template>
<script>
import GuipButton from '@/components/GuipButton.vue';
import ReviewBtn from '@/components/clientSet/reviewBtn.vue';
import ClientForm from '@/components/clientSet/clientForm.vue';
export default {
components: {
ClientForm,
GuipButton
ReviewBtn
},
data() {
return {
@ -39,6 +39,7 @@ export default {
},
mounted() {
// this.getThanksInfo();
},
methods: {
submitFun() {

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

@ -31,13 +31,13 @@
<el-table-column prop="phone" label="反馈用户手机号" min-width="200"></el-table-column>
<el-table-column prop="review_status_desc" label="要求" min-width="200">
<template slot-scope="scope">
<svg-icon :path="require('@/assets/register/tableEdit.svg')" :color="'#8A9099'" @click="handleLunwen(scope.row.status)"
<svg-icon :path="require('@/assets/register/tableEdit.svg')" :color="'#8A9099'" @click="handleLunwen(scope.row.id,'0')"
:hoverColor="'#006AFF'" />
</template>
</el-table-column>
<el-table-column prop="review_status_desc" label="论文" min-width="200">
<template slot-scope="scope">
<SvgIcon :path="require('@/assets/register/tableEdit.svg')" @click="handleLunwen(scope.row.status)" :color="'#8A9099'"
<SvgIcon :path="require('@/assets/register/tableEdit.svg')" @click="handleLunwen(scope.row.id,'1')" :color="'#8A9099'"
:hoverColor="'#006AFF'" />
</template>
</el-table-column>
@ -259,8 +259,32 @@ export default {
query: { id:row.id }
})
},
handleLunwen(row){
this.refuse_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

Loading…
Cancel
Save