Browse Source

多项状态回显导致卡死问题

master
陈薪名 11 months ago
parent
commit
19856d2b04
  1. 25
      src/components/DictTag/src/DictTag.vue
  2. 1
      src/components/SearchHigh/src/SearchHigh.vue
  3. 1
      src/hooks/web/useTable.ts
  4. 24
      src/views/wms/basicDataManage/documentSetting/businesstype/businesstype.data.ts
  5. 22
      src/views/wms/basicDataManage/documentSetting/businesstype/index.vue

25
src/components/DictTag/src/DictTag.vue

@ -2,7 +2,7 @@
import { defineComponent, PropType, ref } from 'vue' import { defineComponent, PropType, ref } from 'vue'
import { isHexColor } from '@/utils/color' import { isHexColor } from '@/utils/color'
import { ElTag } from 'element-plus' import { ElTag } from 'element-plus'
import { DictDataType, getDictOptions } from '@/utils/dict' import { DictDataType, getStrDictOptions } from '@/utils/dict'
export default defineComponent({ export default defineComponent({
name: 'DictTag', name: 'DictTag',
@ -22,28 +22,13 @@ export default defineComponent({
const getDictObj = (dictType: string, value: string) => { const getDictObj = (dictType: string, value: string) => {
// //
if (value.indexOf(',') == -1) { if (value.indexOf(',') == -1) {
const dictOptions = getDictOptions(dictType) const dictOptions = getStrDictOptions(dictType)
dictOptions.forEach((dict: DictDataType) => { dictData.value = dictOptions.find(dictOptionsItem => (dictOptionsItem.value == value))
if (dict.value === value) {
if (dict.colorType + '' === 'primary' || dict.colorType + '' === 'default') {
dict.colorType = ''
}
dictData.value = dict
}
})
} else { } else {
dictDataList = [] dictDataList = []
value.split(',').forEach(item => { value.split(',').forEach(item => {
const dictOptions = getDictOptions(dictType) const dictOptions = getStrDictOptions(dictType)
dictOptions.forEach((dict: DictDataType) => { dictDataList.push(dictOptions.find(dictOptionsItem => (dictOptionsItem.value == item)))
if (dict.value === item) {
if (dict.colorType + '' === 'primary' || dict.colorType + '' === 'default') {
dict.colorType = ''
}
dictData.value = dict
dictDataList.push(dictData.value)
}
})
}) })
} }
} }

1
src/components/SearchHigh/src/SearchHigh.vue

@ -79,7 +79,6 @@ const message = useMessage() // 消息弹窗
const route = useRoute() // const route = useRoute() //
const popoverVisible = ref(false) const popoverVisible = ref(false)
const searchOption_high = ref(props.allSchemas?.tableColumns.filter(item => (item.field != "action"))) const searchOption_high = ref(props.allSchemas?.tableColumns.filter(item => (item.field != "action")))
console.log(searchOption_high.value);
const moreListData = ref({ const moreListData = ref({
filters:[] filters:[]
}) })

1
src/hooks/web/useTable.ts

@ -150,7 +150,6 @@ export const useTable = <T = any>(config?: UseTableConfig<T>) => {
const res = await config?.getListApi(unref(paramsObj)).finally(() => { const res = await config?.getListApi(unref(paramsObj)).finally(() => {
tableObject.loading = false tableObject.loading = false
}) })
console.log('res',res)
if (res) { if (res) {
tableObject.tableList = (res as unknown as ResponseType).list tableObject.tableList = (res as unknown as ResponseType).list
tableObject.total = (res as unknown as ResponseType).total ?? 0 tableObject.total = (res as unknown as ResponseType).total ?? 0

24
src/views/wms/basicDataManage/documentSetting/businesstype/businesstype.data.ts

@ -50,8 +50,8 @@ export const Businesstype = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '可用物品类型范围', label: '可用物品类型范围',
field: 'itemTypes', field: 'itemTypes',
// dictType: DICT_TYPE.ITEM_TYPE, dictType: DICT_TYPE.ITEM_TYPE,
// dictClass: 'string', dictClass: 'string',
isTable: true, isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
@ -67,8 +67,8 @@ export const Businesstype = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '可用物品状态范围', label: '可用物品状态范围',
field: 'itemStatuses', field: 'itemStatuses',
// dictType: DICT_TYPE.ITEM_STATUS, dictType: DICT_TYPE.ITEM_STATUS,
// dictClass: 'string', dictClass: 'string',
isTable: true, isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
@ -78,8 +78,8 @@ export const Businesstype = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '出库库位类型范围', label: '出库库位类型范围',
field: 'outLocationTypes', field: 'outLocationTypes',
// dictType: DICT_TYPE.LOCATION_TYPE, dictType: DICT_TYPE.LOCATION_TYPE,
// dictClass: 'string', dictClass: 'string',
isTable: true, isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
@ -95,8 +95,8 @@ export const Businesstype = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '入库库位类型范围', label: '入库库位类型范围',
field: 'inLocationTypes', field: 'inLocationTypes',
// dictType: DICT_TYPE.LOCATION_TYPE, dictType: DICT_TYPE.LOCATION_TYPE,
// dictClass: 'string', dictClass: 'string',
isTable: true, isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
@ -150,8 +150,8 @@ export const Businesstype = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '出库库存状态范围', label: '出库库存状态范围',
field: 'outInventoryStatuses', field: 'outInventoryStatuses',
// dictType: DICT_TYPE.INVENTORY_STATUS, dictType: DICT_TYPE.INVENTORY_STATUS,
// dictClass: 'string', dictClass: 'string',
isTable: true, isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
@ -167,8 +167,8 @@ export const Businesstype = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '入库库存状态范围', label: '入库库存状态范围',
field: 'inInventoryStatuses', field: 'inInventoryStatuses',
// dictType: DICT_TYPE.INVENTORY_STATUS, dictType: DICT_TYPE.INVENTORY_STATUS,
// dictClass: 'string', dictClass: 'string',
isTable: true, isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {

22
src/views/wms/basicDataManage/documentSetting/businesstype/index.vue

@ -149,13 +149,13 @@ const butttondata = [
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { if (val == 'edit') {
// //
// const res = await BusinesstypeApi.getItempackaging(row.id) const rowSplit = JSON.parse(JSON.stringify(row))
// row.itemTypes = row.itemTypes.split(',') rowSplit.itemTypes = rowSplit.itemTypes.split(',')
// row.outLocationTypes = row.outLocationTypes.split(',') rowSplit.outLocationTypes = rowSplit.outLocationTypes.split(',')
// row.inLocationTypes = row.inLocationTypes.split(',') rowSplit.inLocationTypes = rowSplit.inLocationTypes.split(',')
// row.outInventoryStatuses = row.outInventoryStatuses.split(',') rowSplit.outInventoryStatuses = rowSplit.outInventoryStatuses.split(',')
// row.inInventoryStatuses = row.inInventoryStatuses.split(',') rowSplit.inInventoryStatuses = rowSplit.inInventoryStatuses.split(',')
openForm('update', row) openForm('update', rowSplit)
} else if (val == 'delete') { } else if (val == 'delete') {
// //
handleDelete(row.id) handleDelete(row.id)
@ -165,7 +165,6 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = (type: string, row?: any) => {
console.log(row)
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }
@ -289,13 +288,6 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
await getList() await getList()
// tableObject.tableList.forEach((item) => {
// item.itemTypes = item.itemTypes.split(',')
// item.outLocationTypes = item.outLocationTypes.split(',')
// item.inLocationTypes = item.inLocationTypes.split(',')
// item.outInventoryStatuses = item.outInventoryStatuses.split(',')
// item.inInventoryStatuses = item.inInventoryStatuses.split(',')
// })
// console.log(300, tableObject.tableList) // console.log(300, tableObject.tableList)
importTemplateData.templateUrl = await BusinesstypeApi.importTemplate() importTemplateData.templateUrl = await BusinesstypeApi.importTemplate()
}) })

Loading…
Cancel
Save