feat: 🚀 生成人
This commit is contained in:
1
src/auto-import.d.ts
vendored
1
src/auto-import.d.ts
vendored
@@ -5,6 +5,7 @@
|
|||||||
export {}
|
export {}
|
||||||
declare global {
|
declare global {
|
||||||
const EffectScope: typeof import("vue")["EffectScope"];
|
const EffectScope: typeof import("vue")["EffectScope"];
|
||||||
|
const ElMessage: typeof import("element-plus/es")["ElMessage"];
|
||||||
const computed: typeof import("vue")["computed"];
|
const computed: typeof import("vue")["computed"];
|
||||||
const createApp: typeof import("vue")["createApp"];
|
const createApp: typeof import("vue")["createApp"];
|
||||||
const customRef: typeof import("vue")["customRef"];
|
const customRef: typeof import("vue")["customRef"];
|
||||||
|
|||||||
@@ -158,6 +158,9 @@ const { selectionChange, selectedList, selectedListIds, isSelected } = useSelect
|
|||||||
|
|
||||||
// 清空选中数据列表
|
// 清空选中数据列表
|
||||||
const clearSelection = () => tableRef.value!.clearSelection();
|
const clearSelection = () => tableRef.value!.clearSelection();
|
||||||
|
|
||||||
|
console.log(props.initParam, "=props.initParam=");
|
||||||
|
|
||||||
// 表格操作 Hooks
|
// 表格操作 Hooks
|
||||||
const { tableData, pageable, searchParam, searchInitParam, getTableList, search, reset, handleSizeChange, handleCurrentChange } =
|
const { tableData, pageable, searchParam, searchInitParam, getTableList, search, reset, handleSizeChange, handleCurrentChange } =
|
||||||
useTable(
|
useTable(
|
||||||
|
|||||||
@@ -384,6 +384,16 @@ const handleEmitClear = (item: any) => {
|
|||||||
$Bus.emit("clearBoxMarkIndexCreator");
|
$Bus.emit("clearBoxMarkIndexCreator");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
//
|
||||||
|
// $Bus.on("setBarCodeFormCreateUser", () => {
|
||||||
|
// if (routeName.value === "boxCode" || routeName.value === "barCode" || routeName.value === "antiCode") {
|
||||||
|
// _searchParam.value.createUser = userStore.userInfo.nickname;
|
||||||
|
// console.log(_searchParam.value, "= _searchParam.value.createUser=");
|
||||||
|
// }
|
||||||
|
// if (routeName.value === "boxMarkIndex") {
|
||||||
|
// _searchParam.value.creator = userStore.userInfo.nickname;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scope>
|
<style lang="scss" scope>
|
||||||
@import "../index.scss";
|
@import "../index.scss";
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Table } from "./interface";
|
import { Table } from "./interface";
|
||||||
import { reactive, computed, toRefs } from "vue";
|
import { reactive, computed, toRefs } from "vue";
|
||||||
import $Bus from "@/utils/mittBus";
|
import $Bus from "@/utils/mittBus";
|
||||||
|
import { useUserStore } from "@/stores/modules/user";
|
||||||
/**
|
/**
|
||||||
* @description table 页面操作方法封装
|
* @description table 页面操作方法封装
|
||||||
* @param {Function} api 获取表格数据 api 方法 (必传)
|
* @param {Function} api 获取表格数据 api 方法 (必传)
|
||||||
@@ -62,9 +62,6 @@ export const useTable = (
|
|||||||
try {
|
try {
|
||||||
// 先把初始化参数和分页参数放到总参数里面 initParam
|
// 先把初始化参数和分页参数放到总参数里面 initParam
|
||||||
Object.assign(state.totalParam, isPageable ? pageParam.value : {});
|
Object.assign(state.totalParam, isPageable ? pageParam.value : {});
|
||||||
// console.log(state.searchInitParam, "=========state.searchInitParam===");
|
|
||||||
// console.log(initParam, "=========initParam===");
|
|
||||||
|
|
||||||
let { data, totalCount } = await api({ ...state.searchInitParam, ...initParam, ...state.totalParam });
|
let { data, totalCount } = await api({ ...state.searchInitParam, ...initParam, ...state.totalParam });
|
||||||
state.tableData = data;
|
state.tableData = data;
|
||||||
|
|
||||||
@@ -141,21 +138,31 @@ export const useTable = (
|
|||||||
state.searchParam = {};
|
state.searchParam = {};
|
||||||
// 重置搜索表单的时,如果有默认搜索参数,则重置默认的搜索参数
|
// 重置搜索表单的时,如果有默认搜索参数,则重置默认的搜索参数
|
||||||
Object.keys(state.searchInitParam).forEach(key => {
|
Object.keys(state.searchInitParam).forEach(key => {
|
||||||
|
console.log(key, "=============");
|
||||||
state.searchParam[key] = state.searchInitParam[key];
|
state.searchParam[key] = state.searchInitParam[key];
|
||||||
});
|
});
|
||||||
console.log(routeName, "=routeName=");
|
const userStore: any = useUserStore();
|
||||||
if (routeName === "barCode") {
|
if (routeName === "boxCode" || routeName === "barCode" || routeName === "antiCode") {
|
||||||
$Bus.emit("clearBarCodeCreateUser");
|
state.searchParam.createUser = userStore.userInfo.nickname;
|
||||||
}
|
|
||||||
if (routeName === "boxCode") {
|
|
||||||
$Bus.emit("clearBoxCodeCreateUser");
|
|
||||||
}
|
}
|
||||||
if (routeName === "boxMarkIndex") {
|
if (routeName === "boxMarkIndex") {
|
||||||
$Bus.emit("clearBoxMarkIndexCreator");
|
state.searchParam.creator = userStore.userInfo.nickname;
|
||||||
}
|
|
||||||
if (routeName === "antiCode") {
|
|
||||||
$Bus.emit("clearBoxAntiCodeCreator");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// // console.log(routeName, "=routeName=");
|
||||||
|
// if (routeName === "barCode") {
|
||||||
|
// // $Bus.emit("setBarCodeFormCreateUser");
|
||||||
|
// // $Bus.emit("clearBarCodeCreateUser");
|
||||||
|
// }
|
||||||
|
// if (routeName === "boxCode") {
|
||||||
|
// $Bus.emit("clearBoxCodeCreateUser");
|
||||||
|
// }
|
||||||
|
// if (routeName === "boxMarkIndex") {
|
||||||
|
// $Bus.emit("clearBoxMarkIndexCreator");
|
||||||
|
// }
|
||||||
|
// if (routeName === "antiCode") {
|
||||||
|
// $Bus.emit("clearBoxAntiCodeCreator");
|
||||||
|
// }
|
||||||
updatedTotalParam();
|
updatedTotalParam();
|
||||||
getTableList();
|
getTableList();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export const PRINT_CODE_FORM_DATA: FormItem[] = [
|
|||||||
{
|
{
|
||||||
prop: "serialNumbers",
|
prop: "serialNumbers",
|
||||||
placeholder: "请输入序列号",
|
placeholder: "请输入序列号",
|
||||||
type: "input",
|
type: "inputBtn",
|
||||||
isArray: true,
|
isArray: true,
|
||||||
label: "序列号: "
|
label: "序列号: "
|
||||||
},
|
},
|
||||||
@@ -108,7 +108,7 @@ export const PRINT_CODE_FORM_DATA: FormItem[] = [
|
|||||||
{
|
{
|
||||||
prop: "numberCodes",
|
prop: "numberCodes",
|
||||||
placeholder: "请输入数字序列号",
|
placeholder: "请输入数字序列号",
|
||||||
type: "input",
|
type: "inputBtn",
|
||||||
isArray: true,
|
isArray: true,
|
||||||
label: "数字序列号: "
|
label: "数字序列号: "
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -718,7 +718,6 @@ const handleRemoteClear = () => {
|
|||||||
|
|
||||||
// 规格型号转换确认
|
// 规格型号转换确认
|
||||||
const handleSpecificationConfirm = async () => {
|
const handleSpecificationConfirm = async () => {
|
||||||
console.log(datas.remoteSelectItem, "=datas.printCodeRuleFormData=");
|
|
||||||
let params: any = {
|
let params: any = {
|
||||||
generateRecordId: datas.printCodeRuleFormData.generateRecordId,
|
generateRecordId: datas.printCodeRuleFormData.generateRecordId,
|
||||||
serialNumbers: [],
|
serialNumbers: [],
|
||||||
@@ -998,7 +997,6 @@ onMounted(() => {
|
|||||||
datas.ruleForm.createUser = createUser;
|
datas.ruleForm.createUser = createUser;
|
||||||
datas.initParam.createUser = createUser;
|
datas.initParam.createUser = createUser;
|
||||||
});
|
});
|
||||||
//searchBarCodeSsDownLoad
|
|
||||||
$Bus.on("searchBarCodeSsDownLoad", () => {
|
$Bus.on("searchBarCodeSsDownLoad", () => {
|
||||||
resetVisibleGroups();
|
resetVisibleGroups();
|
||||||
datas.printCodeRuleFormData.isDownLoad = false;
|
datas.printCodeRuleFormData.isDownLoad = false;
|
||||||
|
|||||||
@@ -301,7 +301,8 @@ const handleBeforeClose = async () => {
|
|||||||
let obj = {
|
let obj = {
|
||||||
materialNumber: item.materialNumber,
|
materialNumber: item.materialNumber,
|
||||||
serialNumber: item.isNumber ? item.numberCode : item.serialNumber,
|
serialNumber: item.isNumber ? item.numberCode : item.serialNumber,
|
||||||
twoSerialNumber: item?.twoSerialNumber ? item?.twoSerialNumber : ""
|
twoSerialNumber: item?.twoSerialNumber ? item?.twoSerialNumber : "",
|
||||||
|
specifications: item.specifications
|
||||||
// twoNumberCode: item?.twoNumberCode ? item?.twoNumberCode : ""
|
// twoNumberCode: item?.twoNumberCode ? item?.twoNumberCode : ""
|
||||||
};
|
};
|
||||||
newParamsArray.push(obj);
|
newParamsArray.push(obj);
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ export const initSave = (datas: any, type: any, formTableRef: any, refInput: any
|
|||||||
let obj = {
|
let obj = {
|
||||||
materialNumber: item.materialNumber,
|
materialNumber: item.materialNumber,
|
||||||
serialNumber: item.isNumber ? item.numberCode : item.serialNumber,
|
serialNumber: item.isNumber ? item.numberCode : item.serialNumber,
|
||||||
twoSerialNumber: item?.twoSerialNumber ? item?.twoSerialNumber : ""
|
twoSerialNumber: item?.twoSerialNumber ? item?.twoSerialNumber : "",
|
||||||
|
specifications: item.specifications
|
||||||
};
|
};
|
||||||
newParamsArray.push(obj);
|
newParamsArray.push(obj);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user