Browse Source

本地导出动态跟随侧边栏,修复已知bug

dev-xx
马远东 5 months ago
parent
commit
ced09302a3
  1. 36
      src/components/Tableexportcomponent/Tableexportcomponent.vue
  2. 6
      src/components/edittablehead/index.vue
  3. 2
      src/views/aftersales/aftersalesWorkOrder.vue
  4. 4
      src/views/aftersales/aftersalesWorkOrderAdd.vue

36
src/components/Tableexportcomponent/Tableexportcomponent.vue

@ -11,6 +11,7 @@
<el-tabs v-model="radio" class="el_TablePage_radio">
<el-tab-pane label="当前页全部导出" name="1"></el-tab-pane>
<el-tab-pane label="当前页勾选导出" name="2"></el-tab-pane>
<el-tab-pane label="全部数据导出" name="3"></el-tab-pane>
</el-tabs>
<el-transfer
@ -34,6 +35,8 @@ import { ref, computed, watch } from 'vue';
import { ElMessage } from 'element-plus';
import * as XLSX from 'xlsx';
import { Download } from '@element-plus/icons-vue';
import { useRoute } from 'vue-router';
const $route = useRoute();
const radio = ref('1');
//
const props = defineProps({
@ -58,18 +61,20 @@ const props = defineProps({
watch(
() => props.tcTableexport,
(newPath, oldPath) => {
menuData.value = JSON.parse(JSON.stringify(props.menuData));
const removeColumn = columnLabel => {
const index = menuData.value.findIndex(item => item.label === columnLabel);
if (index !== -1) {
menuData.value.splice(index, 1);
}
};
initializeCheckedColumns();
// ''
removeColumn('序号');
removeColumn('操作');
removeColumn('复选框');
if (newPath) {
menuData.value = JSON.parse(JSON.stringify(props.menuData));
const removeColumn = columnLabel => {
const index = menuData.value.findIndex(item => item.label === columnLabel);
if (index !== -1) {
menuData.value.splice(index, 1);
}
};
initializeCheckedColumns();
// ''
removeColumn('序号');
removeColumn('操作');
removeColumn('复选框');
}
},
{ immediate: true, deep: true }
);
@ -91,8 +96,13 @@ removeColumn('复选框');
const exportFileName = ref('');
//
const checkedColumns = ref([]);
// const initializeCheckedColumns = () => {
// checkedColumns.value = transferData.value.map(item => item.key);
// };
const initializeCheckedColumns = () => {
checkedColumns.value = transferData.value.map(item => item.key);
checkedColumns.value = transferData.value
.filter(item => item.head !== true) // head false
.map(item => item.key);
};
// el-transfer

6
src/components/edittablehead/index.vue

@ -50,6 +50,7 @@ import { getTableSeting, postSaveTableSeting } from '@/api/basic/table';
const functions = inject('functions') as any;
import Sortable from 'sortablejs';
import { getObjType, handleClearTableQuery } from '@/utils/util';
import { it } from 'element-plus/es/locale';
interface TableColumnType {
/** 表格列的key */
prop: string;
@ -181,6 +182,11 @@ const initTable = async () => {
columnRef.value = [..._setArr];
handleClearTableQuery(_setArr);
emit('update:modelValue', _setArr);
// let _TempArr = _setArr.map(item => {
// return { head: item.head ?? false, label: item.label };
// });
// sessionStorage.setItem(submitData.tableKey, JSON.stringify(_TempArr));
} catch (error) {
console.log('error :>> ', error);
}

2
src/views/aftersales/aftersalesWorkOrder.vue

@ -1007,7 +1007,7 @@ const details = reactive({
/** 时间选择器数据 */
stockupDate: [],
/** 列表 */
columnListPublic: deepClone(columnList), //
columnListPublic:columnList, //
/** 列表数据 */
data: [],
/** 页面loading */

4
src/views/aftersales/aftersalesWorkOrderAdd.vue

@ -844,11 +844,11 @@ const ruleForm = reactive({
],
first: [
{ required: false, message: '请输入一级品', trigger: ['blur', 'change'] },
{ max: 10, message: '订单自编号最多10位', trigger: 'change' },
{ max: 20, message: '一级品最多10位', trigger: 'change' },
],
secondary: [
{ required: false, message: '请输入二级品', trigger: ['blur', 'change'] },
{ max: 10, message: '订单自编号最多10位', trigger: 'change' },
{ max: 20, message: '二级品最多10位', trigger: 'change' },
],
brandName: [{ required: false, message: '请输入品牌', trigger: ['blur', 'change'] }],
businessId: [{ required: true, message: '请选择责任方', trigger: ['blur', 'change'] }],

Loading…
Cancel
Save