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