Browse Source

EAM ——> 文档类型 更新

master_hella_20240701
gaojs 6 months ago
parent
commit
e86f0c38c7
  1. 10
      src/views/eam/documentType/documentType.data.ts
  2. 6
      src/views/eam/documentType/index.vue
  3. 8
      src/views/eam/documentTypeSelectSet/itemSelectSetForm.vue

10
src/views/eam/documentType/documentType.data.ts

@ -23,7 +23,10 @@ export const DocumentType = useCrudSchemas(reactive<CrudSchema[]>([
label: '设备编码', label: '设备编码',
field: 'code', field: 'code',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
}, },
{ {
label: '名称', label: '名称',
@ -37,7 +40,10 @@ export const DocumentType = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.DEVICE_TYPE, dictType: DICT_TYPE.DEVICE_TYPE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true, isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: { form: {
component: 'Select' component: 'Select'
} }

6
src/views/eam/documentType/index.vue

@ -27,9 +27,9 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #code="{row}"> <template #name="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> <el-button type="primary" link @click="openDetail(row, '代码', row.name)">
<span>{{ row.code }}</span> <span>{{ row.name }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">

8
src/views/eam/documentTypeSelectSet/itemSelectSetForm.vue

@ -29,8 +29,8 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item label="文档类型项" prop="items"> <el-form-item label="文档类型项" prop="items">
<div class="tag-container flex gap-2"> <div class="tag-container flex gap-2">
<el-tag v-for="ent in tags" :key="ent.code" closable :disable-transitions="false" @close="handleClose(ent.id)"> <el-tag v-for="ent in tags" :key="ent.name" closable :disable-transitions="false" @close="handleClose(ent.id)">
{{ ent.code}} {{ ent.name}}
</el-tag> </el-tag>
<el-input v-if="inputVisible" ref="InputRef" v-model="inputValue" class="w-20" size="small"/> <el-input v-if="inputVisible" ref="InputRef" v-model="inputValue" class="w-20" size="small"/>
<el-button v-else class="button-new-tag" size="small" @click="addItem"> <el-button v-else class="button-new-tag" size="small" @click="addItem">
@ -156,10 +156,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
if (formField === 'wenDangItem') { if (formField === 'wenDangItem') {
console.log(val) console.log(val)
val.forEach(item => { val.forEach(item => {
const isExist = tags.value.some(tag => tag.code === item.code); const isExist = tags.value.some(tag => tag.name === item.name);
if (!isExist){ if (!isExist){
const newItem = {}; const newItem = {};
newItem['code'] = item.code; newItem['name'] = item.name;
newItem['id'] = item.id; newItem['id'] = item.id;
tags.value.push(newItem); tags.value.push(newItem);
} }

Loading…
Cancel
Save