Browse Source

修改模板配置、基本信息保存交互

pull/139/head
zq 4 days ago
parent
commit
e8cbe3c15b
  1. 27
      src/components/clientSet/clientForm.vue
  2. 1
      src/components/clientSet/reviewBtn.vue
  3. 2
      src/store/index.js
  4. 22
      src/views/super/clientSet/coverInfoPage.vue
  5. 14
      src/views/super/clientSet/mainTextPage.vue
  6. 3
      src/views/super/clientSet/switchPage.vue
  7. 6
      src/views/super/paiban/tpl.vue

27
src/components/clientSet/clientForm.vue

@ -59,10 +59,12 @@
<div v-if="computedShowIndentation" class="grayLabel showIndentation"> <div v-if="computedShowIndentation" class="grayLabel showIndentation">
<div class="flex-between"> <div class="flex-between">
<GuipSelect v-model="coverInfo.indentation['first_line_indent'].value" :options="speFormatList" :client-form-flex="true" <GuipSelect v-model="first_indentation" :options="speFormatList" :client-form-flex="true"
placeholder="请选择" label="特殊格式" width="127px" /> placeholder="请选择" label="特殊格式" width="127px" />
<GuipSelect :options="indentationUnitList" v-model="coverInfo.indentation['first_line_indent'].unit" <!-- <GuipSelect :options="indentationUnitList" v-model="coverInfo.indentation['first_line_indent'].unit"
placeholder="请选择" :client-form-flex="true" label="缩进单位" width="127px" /> placeholder="请选择" :client-form-flex="true" label="缩进单位" width="127px" /> -->
<GuipInput v-model="coverInfo.indentation['first_line_indent'].value" :client-form-flex="true"
placeholder="请填写" label="文本之前" width="127px" unit="字符" />
</div> </div>
<div class="flex-between" v-if="coverInfo.indentation"> <div class="flex-between" v-if="coverInfo.indentation">
<GuipInput v-model="coverInfo.indentation.text_before_indent.value" :client-form-flex="true" <GuipInput v-model="coverInfo.indentation.text_before_indent.value" :client-form-flex="true"
@ -98,9 +100,9 @@
<div class="grayLabel"> <div class="grayLabel">
<div class="flex-between"> <div class="flex-between">
<GuipInput v-model="coverInfo.spacing.paragraph_before_spacing.value" label="段前" <GuipInput v-model="coverInfo.spacing.paragraph_before_spacing.value" label="段前"
placeholder="请填写" :client-form-flex="true" width="127px" unit="" /> placeholder="请填写" :client-form-flex="true" width="127px" unit="" />
<GuipInput v-model="coverInfo.spacing.paragraph_end_spacing.value" label="段后" <GuipInput v-model="coverInfo.spacing.paragraph_end_spacing.value" label="段后"
placeholder="请填写" :client-form-flex="true" width="127px" unit="" /> placeholder="请填写" :client-form-flex="true" width="127px" unit="" />
</div> </div>
<div class="flex-between"> <div class="flex-between">
<GuipInput v-model="coverInfo.spacing.line_spacing.value" label="行间距" placeholder="请填写" <GuipInput v-model="coverInfo.spacing.line_spacing.value" label="行间距" placeholder="请填写"
@ -228,6 +230,7 @@ export default {
// title_pos: '', // // title_pos: '', //
// img_pos: '', // // img_pos: '', //
indentation: '0', // indentation: '0', //
first_indentation: '0', //
// spe_format: '', // // spe_format: '', //
// delimiter: '', // // delimiter: '', //
coverInfo: { coverInfo: {
@ -334,10 +337,10 @@ export default {
// //
alignmentOptions() { alignmentOptions() {
const alignments = this.client_tpl_options?.alignment || {}; const alignments = this.client_tpl_options?.alignment || {};
console.log(Object.keys(alignments).map(key => ({ // console.log(Object.keys(alignments).map(key => ({
label: alignments[key], // label: alignments[key],
value: key // value: key
})),'=00000'); // })),'=00000');
return Object.keys(alignments).map(key => ({ return Object.keys(alignments).map(key => ({
label: alignments[key], label: alignments[key],
value: key value: key
@ -463,7 +466,7 @@ export default {
* 提交按钮点击 * 提交按钮点击
*/ */
submitDoctorBaseInfo() { submitDoctorBaseInfo() {
console.log(this.getFormData(),'====--000'); // console.log(this.getFormData(),'====--000');
this.$emit('submit', this.getFormData()); this.$emit('submit', this.getFormData());
}, },
@ -471,8 +474,10 @@ export default {
* 内部重置方法 * 内部重置方法
*/ */
internalCancel() { internalCancel() {
// console.log(this.targetOriginalData,'====99888');
// this.client_tpl_type === 'edit' add type
// //
if (this.client_tpl_type === 'edit' && this.targetOriginalData) { if (this.targetOriginalData) {
// initData // initData
this.restoreTargetOriginalData(); this.restoreTargetOriginalData();
} else { } else {

1
src/components/clientSet/reviewBtn.vue

@ -30,7 +30,6 @@ export default {
}, },
methods:{ methods:{
submitFun(){ submitFun(){
// this.$emit('submit')
// //
try { try {
this.$http('POST', '/supernew/ajax_update_paiban_template_review_status', { this.$http('POST', '/supernew/ajax_update_paiban_template_review_status', {

2
src/store/index.js

@ -855,7 +855,7 @@ export default new Vuex.Store({
async fetchClientConfig({ commit,state },{id=''}) { async fetchClientConfig({ commit,state },{id=''}) {
try { try {
Vue.prototype.$http('POST', '/supernew/ajax_get_paiban_template_config', { Vue.prototype.$http('POST', '/supernew/ajax_get_paiban_template_config', {
template_id:id || state.client_tpl_id template_id:id || state.client_tpl_id || localStorage.getItem('template_id') || ''
}).then(response => { }).then(response => {
commit('SET_CLIENT_TPL_CONFIG', { commit('SET_CLIENT_TPL_CONFIG', {
...response.data, ...response.data,

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

@ -134,25 +134,26 @@ export default {
} }
if(id){ if(id){
this.template_id = id; this.template_id = id;
store.commit('SET_CLIENTTEMID', this.template_id);
} }
if(type == 'add'){ if(type == 'add'){
store.commit('SET_CLIENTTPLREVIEWSTATUS', 1); store.commit('SET_CLIENTTPLREVIEWSTATUS', 1);
} }
store.commit('SET_CLIENTTEMID', this.template_id);
store.commit('SET_CLIENTTEMTYPE', this.type); store.commit('SET_CLIENTTEMTYPE', this.type);
const editInfo = JSON.parse(localStorage.getItem('curtplInfo')) || ''; const editInfo = JSON.parse(localStorage.getItem('curtplInfo')) || '';
if(editInfo){ if(editInfo){
this.editInfo = JSON.parse(JSON.stringify(editInfo)); this.editInfo = JSON.parse(JSON.stringify(editInfo));
this.coverInfo = { this.coverInfo = {
school:editInfo.school_id, school:editInfo.school_id || editInfo.school ,
school_name:editInfo.school_name, school_name:editInfo.school_name,
college_id:editInfo.college_name == '-1'? '-1' :'1', college_id:editInfo.college_name == '-1'? '-1' :'1',
college:editInfo.college_name, college:editInfo.college_name == '-1' ? '' :editInfo.college_name,
degree:editInfo.degree_id, degree:editInfo.degree_id,
// qrcode_path:editInfo.cover_img // qrcode_path:editInfo.cover_img
} }
this.template_id = editInfo.id; this.template_id = editInfo.id;
console.log(this.coverInfo,'zhixingle---这里');
} }
this.getStatusList() this.getStatusList()
@ -274,18 +275,19 @@ export default {
// //
handleConfirmConfirm(){ handleConfirmConfirm(){
let props={ let props={
school: this.coverInfo.school, school: this.coverInfo.school || this.client_tpl_config.school_id,
college: this.coverInfo.college_id == '1' ? this.coverInfo.college : '', college: this.coverInfo.college_id == '1' ? this.coverInfo.college : '',
degree: this.coverInfo.degree, degree: this.coverInfo.degree,
} }
let url = '/supernew/ajax_add_paiban_template' let url = '/supernew/ajax_add_paiban_template'
if(this.template_id){ if(this.template_id || this.client_tpl_config.school_id){
props.template_id = this.template_id; props.template_id = this.template_id || localStorage.getItem('template_id');
url ='/supernew/ajax_update_paiban_template_info' url ='/supernew/ajax_update_paiban_template_info'
} }
if(this.coverInfo.school){ if(this.coverInfo.school){
props.school = this.coverInfo.school; props.school = this.coverInfo.school;
} }
console.log(url,this.coverInfo,this.client_tpl_config,'000--====000');
// //
// localStorage.setItem('curtplInfo', JSON.stringify({...this.coverInfo,degree_id:this.coverInfo.degree})) // localStorage.setItem('curtplInfo', JSON.stringify({...this.coverInfo,degree_id:this.coverInfo.degree}))
// store.commit('SET_CLIENTTEMID', '999'); // store.commit('SET_CLIENTTEMID', '999');
@ -310,13 +312,15 @@ export default {
}else{ }else{
console.log(this.coverInfo,'coverInfo信息'); console.log(this.coverInfo,'coverInfo信息');
localStorage.setItem('curtplInfo', JSON.stringify({...this.coverInfo, localStorage.setItem('curtplInfo', JSON.stringify({...this.coverInfo,
id:response.data.template_id,
college_name:this.coverInfo.college_id == '1' ? this.coverInfo.college : '-1', college_name:this.coverInfo.college_id == '1' ? this.coverInfo.college : '-1',
school_name:this.coverInfo.school_name, school_name:this.coverInfo.school_name,
degree_id:this.coverInfo.degree})) degree_id:this.coverInfo.degree}))
this.template_id = response.data.template_id this.template_id = response.data.template_id
} }
if(!localStorage.getItem('template_id')){
localStorage.setItem('template_id',this.template_id) localStorage.setItem('template_id',this.template_id)
}
store.dispatch('fetchClientConfig',{id:this.template_id}); store.dispatch('fetchClientConfig',{id:this.template_id});
store.commit('SET_CLIENTTEMID', this.template_id); store.commit('SET_CLIENTTEMID', this.template_id);
@ -343,6 +347,10 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.coverInfoPage{
height: calc(100% - 130px);
overflow-y: auto;
}
.flex-common { .flex-common {
align-items: flex-start; align-items: flex-start;
padding: 24px 32px; padding: 24px 32px;

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

@ -147,19 +147,11 @@ export default {
console.log('外部提交方法:', formData,refName); console.log('外部提交方法:', formData,refName);
// refName API // refName API
this.submitConfig(formData); this.submitConfig(formData);
// switch (refName) {
// case 'level_1_heading':
// this.submitConfig(formData);
// break;
// case 'level_2_heading':
// this.submitConfig(formData);
// break;
// }
}, },
async submitConfig(data) { async submitConfig(data) {
const temId = localStorage.getItem('template_id')
// API // API
if(!this.client_tpl_id && !this.$route.query.id){ if(!this.client_tpl_id && !this.$route.query.id && !temId){
this.$Message.error('模板ID不存在'); this.$Message.error('模板ID不存在');
return; return;
}else{ }else{
@ -167,7 +159,7 @@ export default {
} }
await store.dispatch('updateClientConfig',{ await store.dispatch('updateClientConfig',{
id: this.client_tpl_id || this.$route.query.id || localStorage.getItem('template_id'), id: this.client_tpl_id || this.$route.query.id || temId ,
config_json:JSON.stringify(data), config_json:JSON.stringify(data),
message: this.$Message message: this.$Message
}); });

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

@ -49,8 +49,9 @@ export default {
this.time = Date.now(); this.time = Date.now();
return return
} }
console.log(this.is_use_templete,'this.is_use_templete==');
this.$http('POST', '/supernew/ajax_update_paiban_template_status', { this.$http('POST', '/supernew/ajax_update_paiban_template_status', {
status: this.is_use_templete == '1' ? '2' : '1', status: this.is_use_templete ,
template_id:this.$route.query.id template_id:this.$route.query.id
}).then(response => { }).then(response => {
this.$nextTick(() => { this.$nextTick(() => {

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

@ -185,11 +185,10 @@ export default {
this.getList() this.getList()
}, },
async jumpEdit(item){ async jumpEdit(item){
// localStorage
// localStorage.setItem('tpl_id', item.id)
// //
await store.dispatch('fetchClientConfig',{id:item.id}); await store.dispatch('fetchClientConfig',{id:item.id});
localStorage.setItem('curtplInfo', JSON.stringify(item)) localStorage.setItem('curtplInfo', JSON.stringify(item))
localStorage.setItem('template_id', item.id)
// //
this.$router.push({ this.$router.push({
path: '/super/clientSet/coverInfoPage', path: '/super/clientSet/coverInfoPage',
@ -200,7 +199,10 @@ export default {
// //
// //
addTemplete(){ addTemplete(){
//
localStorage.removeItem('curtplInfo') localStorage.removeItem('curtplInfo')
localStorage.removeItem('template_id')
store.commit('SET_CLIENTTEMID', '');
this.$router.push({ this.$router.push({
path: '/super/clientSet/coverInfoPage', path: '/super/clientSet/coverInfoPage',
query: {type:'add' } query: {type:'add' }

Loading…
Cancel
Save