940c0d59 by fanguang

Merge branch 'develop-fan' into develop

2 parents 9d37357a 1c896bcc
......@@ -213,6 +213,17 @@ const routes: RouteRecordRaw[] = [
breadcrumb: false,
cache: true
}
},
{
path: 'standard-import',
name: 'metadataStandardImport',
component: () => import('@/views/data_meta/standard-import.vue'),
meta: {
title: '标准代码导入',
breadcrumb: false,
cache: true,
activeMenu: '/data-meta/metadata-standard/standard-codetable'
}
}
]
}
......
......@@ -26,6 +26,7 @@ const { proxy } = getCurrentInstance() as any;
const cacheStore = useCatchStore()
const standardGuid = ref("")
const standardName = ref('')
const tableSearchInput = ref('')
const tableFields: any = ref([])
const orginData: any = ref([])
......@@ -156,19 +157,17 @@ const tablePageChange = (info) => {
};
const toolBtnClick = (btn) => {
console.log('btnType', btn)
const type = btn.value
if (type == 'export') {
exportData()
} else if (type == 'import') {
const info = {
type: 'dictionary',
standardGuid: standardGuid.value
}
const info = [
{ standardGuid: standardGuid.value, standardName: standardName.value }
]
cacheStore.setCatch('uploadSetting', info)
nextTick(() => {
router.push({
path: '/data-inventory/data-dictionary/import-file',
path: '/data-meta/metadata-standard/standard-import',
});
})
} else if (type == 'submit') {
......@@ -537,6 +536,7 @@ const dialogBtnClick = (btn, info) => {
defineExpose({
standardGuid,
standardName,
getFirstPageData,
checkSave
});
......
......@@ -38,6 +38,7 @@ import {
checkDictionaryData,
getNewDataTypeList
} from '@/api/modules/dataInventory';
import router from '@/router'
const { proxy } = getCurrentInstance() as any;
......@@ -103,6 +104,7 @@ const page = ref({
],
});
const selectRowData = ref([])
const selectedRowData = ref([])
const tableInfo: any = ref({
id: 'data-source-table',
multiple: true,
......@@ -140,6 +142,7 @@ const orginOptions = [
{ label: 'code', value: 'code' },
{ label: 'name', value: 'name' },
]
let codeOptions = ref([])
const orginItems = [
{
label: '标准类型',
......@@ -306,18 +309,17 @@ const formItems: any = ref([
required: true
},
{
label: '编码字段',
label: '编码字段11',
type: 'select',
placeholder: '请选择',
field: 'codeFields',
default: [],
options: [
{ label: 'code', value: 'code' },
{ label: 'name', value: 'name' }
],
options: codeOptions,
clearable: true,
required: true,
multiple: true
multiple: true,
tagsTooltip: true,
filterable: true,
},
{
label: '编码名称',
......@@ -325,10 +327,7 @@ const formItems: any = ref([
placeholder: '请选择',
field: 'codeFieldName',
default: '',
options: [
{ label: 'code', value: 'code' },
{ label: 'name', value: 'name' }
],
options: codeOptions,
clearable: true,
required: true
},
......@@ -759,6 +758,7 @@ const tableSelectionChange = (val, tId) => {
}
} else {
selectRowData.value = val.map((item) => item.guid);
selectedRowData.value = val
}
};
......@@ -789,11 +789,7 @@ const setCodeOptions = () => {
opts.push(row)
}
})
formItems.value.at(-1).children.map(child => {
if (child.type == 'select') {
child.options = opts
}
})
codeOptions.value = opts
}
const toolBtnClick = (btn, data) => {
......@@ -1222,7 +1218,7 @@ const loadDrawer = async () => {
drawerInfo.value.visible = true
console.log('table', formTable.value)
console.log('formInfo', formInfo)
setCodeOptions()
};
const batching = (type) => {
......@@ -1238,6 +1234,26 @@ const batching = (type) => {
open("此操作将永久删除, 是否继续?", "warning", true);
tableInfo.value.loading = false
}
if (type == 'export') {
if (selectRowData.value.length == 0) {
ElMessage({
type: 'error',
message: '请选择代码名称',
})
return
}
// console.log(selectedRowData)
let uploadSetting = selectedRowData.value.map(item => {
return {
standardName: item.codeName,
standardGuid: item.guid
}
})
cacheStore.setCatch('uploadSetting', uploadSetting)
router.push({
path: '/data-meta/metadata-standard/standard-import',
});
}
};
const nodeClick = (data) => {
......@@ -1251,6 +1267,7 @@ const nodeClick = (data) => {
showFiledsPage.value = true
nextTick(() => {
dictFiledsRef.value.standardGuid = data.value
dictFiledsRef.value.standardName = data.label
dictFiledsRef.value.getFirstPageData()
})
} else {
......@@ -1354,6 +1371,7 @@ const setDetailInfo = () => {
drawerInfo.value.container.contents = contents.value['add']
drawerInfo.value.visible = true
setCodeOptions()
}
const saveData = async (params) => {
......@@ -1504,6 +1522,7 @@ onMounted(() => {
<div class="tools_btns">
<el-button type="primary" @click="loadDrawer" v-preReClick>新建</el-button>
<el-button @click="batching('delete')" v-preReClick>批量删除</el-button>
<el-button @click="batching('export')" v-preReClick>批量导入</el-button>
</div>
<el-input class="table_search_input" v-model.trim="tableSearchInput" placeholder="请输入代码名称搜索"
:suffix-icon="Search" clearable @change="val => getFirstPageData()" />
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!