Browse Source

feat:[模板管理][update]

lkf
luojie 2 months ago
parent
commit
93deaca82f
2 changed files with 20 additions and 35 deletions
  1. +19
    -35
      src/components/Template/CustomTable.vue
  2. +1
    -0
      src/views/business/comps/template/comps/sp/SP003.vue

+ 19
- 35
src/components/Template/CustomTable.vue View File

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<div class="custom-table-wrapper">
<div class="custom-table-header">
<div class="custom-table-wrapper" :class="{'no-border': !isBorder}">
<div class="custom-table-header" v-if="isBorder">
<div class="custom-table-row"> <div class="custom-table-row">
<div v-for="(col, index) in columns" :key="index" class="custom-table-cell header-cell" <div v-for="(col, index) in columns" :key="index" class="custom-table-cell header-cell"
:style="getCellWidth(col)"> :style="getCellWidth(col)">
@ -222,7 +222,11 @@ export default {
prefixKey: { prefixKey: {
type: String, type: String,
default: "", default: "",
}
},
isBorder: {//,border
type: Boolean,
default: true,
},
}, },
data() { data() {
return { return {
@ -638,39 +642,10 @@ export default {
// autoUpdateRecord // autoUpdateRecord
updateDataSourceByRowIndex(rowIndex, data) { updateDataSourceByRowIndex(rowIndex, data) {
this.oldLocalDataSource = JSON.parse(JSON.stringify(this.localDataSource)); this.oldLocalDataSource = JSON.parse(JSON.stringify(this.localDataSource));
// if (type === "clickable") {//customclickable
// this.showEditSignDialog(rowIndex,data);
// }else if(type === "blur"){
// this.updateRecords();
// }
this.localDataSource[rowIndex] = { ...this.localDataSource[rowIndex], ...data }; this.localDataSource[rowIndex] = { ...this.localDataSource[rowIndex], ...data };
this.localDataSource = [...this.localDataSource]; this.localDataSource = [...this.localDataSource];
this.checkCompareToOnDataLoad(); this.checkCompareToOnDataLoad();
}, },
showEditSignDialog: _.debounce(function (rowIndex, data) {
const oldData = this.oldLocalDataSource[rowIndex];
let isFirst = false;//,
const isSame = this.compareOldAndCurrentFormFields(data, oldData);
// dataoldDatadatakeyoldData
for (const key in data) {
if (this.isValueEmpty(oldData[key])) {
isFirst = true;
break;
}
}
if (!isFirst && !isSame && this.templateFillType === "actFill") {
console.log("showww")
setTimeout(() => {
EventBus.$emit('showEditSignDialog', { uuid: this.uuid });
}, 100);
} else {
console.log("not show")
this.updateRecords();
}
}, 100),
// newDataoldDatafalse // newDataoldDatafalse
compareOldAndCurrentFormFields(newData, oldData) { compareOldAndCurrentFormFields(newData, oldData) {
for (const key in newData) { for (const key in newData) {
@ -719,9 +694,9 @@ export default {
); );
} }
}, },
onSubBlur(rowIndex, colKey, value) {
this.$emit("blur", { rowIndex, colKey, value, item: this.localDataSource[rowIndex] });
},
// onSubBlur(rowIndex, colKey, value) {
// this.$emit("blur", { rowIndex, colKey, value, item: this.localDataSource[rowIndex] });
// },
// //
hasOrangeBg(rowIndex, colIndex, field) { hasOrangeBg(rowIndex, colIndex, field) {
const key = `${rowIndex}-${colIndex}-${field}`; const key = `${rowIndex}-${colIndex}-${field}`;
@ -780,6 +755,15 @@ export default {
font-size: 14px; font-size: 14px;
color: #606266; color: #606266;
margin-top: 20px; margin-top: 20px;
&.no-border {
border: none;
.custom-table-cell {
border-right: none;
}
.custometable-row {
border-bottom: none;
}
}
} }
.inner-table-cell { .inner-table-cell {

+ 1
- 0
src/views/business/comps/template/comps/sp/SP003.vue View File

@ -20,6 +20,7 @@
:formData="formData" /> :formData="formData" />
<CustomTable fieldItemLabel="template.common.operationSteps" @blur="onHandleTableBlur" <CustomTable fieldItemLabel="template.common.operationSteps" @blur="onHandleTableBlur"
:showAddRow="fillType === 'preFill' ? true : false" :showOperation="fillType === 'actFill'" :showAddRow="fillType === 'preFill' ? true : false" :showOperation="fillType === 'actFill'"
:isBorder="false"
ref="stepTableRef" :columns="stepColumns" :formData="formData"> ref="stepTableRef" :columns="stepColumns" :formData="formData">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion @startConfig="startConfig" @configComplete="configComplete" <TableOpertaion @startConfig="startConfig" @configComplete="configComplete"

Loading…
Cancel
Save