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

1
src/components/clientSet/reviewBtn.vue

@ -30,7 +30,6 @@ export default {
},
methods:{
submitFun(){
// this.$emit('submit')
//
try {
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=''}) {
try {
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 => {
commit('SET_CLIENT_TPL_CONFIG', {
...response.data,

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

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

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

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

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

@ -49,8 +49,9 @@ export default {
this.time = Date.now();
return
}
console.log(this.is_use_templete,'this.is_use_templete==');
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
}).then(response => {
this.$nextTick(() => {

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

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

Loading…
Cancel
Save