d8969b89 by fanguang Committed by lihua

fix

1 parent f3abdb2e
......@@ -552,3 +552,8 @@ export const getContractDetail = (params) => request({
method: 'get',
params
})
// 获取所有字典
export const getDictAllList = () => request({
url: `${import.meta.env.VITE_APP_CONFIG_URL}/dict/data/get-all`
})
\ No newline at end of file
......
......@@ -314,3 +314,31 @@ export const exportStandardCodeData = (params) => request({
data: params,
responseType: 'blob'
})
/** 元数据标准-树形列表 */
export const getMetaStandardTree = () => request({
url: `${import.meta.env.VITE_APP_STANDARD_URL}/meta-standard/list-tree`,
method: 'get'
})
/** 元数据标准-新增 */
export const saveMetaStandard = (params) => request({
url: `${import.meta.env.VITE_APP_STANDARD_URL}/meta-standard/save`,
method: 'post',
data: params
})
/** 元数据标准-修改 */
export const updateMetaStandard = (params) => request({
url: `${import.meta.env.VITE_APP_STANDARD_URL}/meta-standard/update`,
method: 'put',
data: params
})
/** 元数据标准-删除 */
export const deleteMetaStandard = (params) => request({
url: `${import.meta.env.VITE_APP_STANDARD_URL}/meta-standard/delete`,
method: 'delete',
data: params
})
/** 元数据标准-详情 */
export const getMetaStandardDetail = (guid) => request({
url: `${import.meta.env.VITE_APP_STANDARD_URL}/meta-standard/detail?guid=${guid}`,
method: 'get'
})
\ No newline at end of file
......
......@@ -201,7 +201,7 @@ const formItems: any = ref([
},
{
label: '排序',
type: 'inputNumber',
type: 'input',
placeholder: '请输入',
field: 'orderNum',
default: '',
......@@ -241,6 +241,7 @@ const formItems: any = ref([
required: true,
multiple: true,
tagsTooltip: true,
collapse: true,
filterable: true,
visible: true
},
......@@ -271,7 +272,25 @@ const formRules: any = ref({
standard: { required: true, message: '请输入标准号' },
standardName: { required: true, message: '请输入标准名称' },
publishingUnitCode: { required: true, message: '请选择发布单位' },
orderNum: { required: true, message: '请输入排序' },
orderNum: {
required: true,
validator: (rule, value, callback) => {
if (value === 0) {
callback();
return;
}
if (!value) {
callback(new Error('请填写排序'));
return;
}
const r = /(^[0-9]([0-9]*)$|^[0-9]$)/; // 正整数(可以以0打头)
if (value && !r.test(value)) {
callback(new Error('请填写大于或等于零整数'));
return;
}
callback();
}
},
typeCode: { required: true, message: '请选择代码类型' },
codeFields: { required: true, message: '请选择编码字段' },
codeFieldName: { required: true, message: '请选择编码名称' }
......@@ -292,7 +311,7 @@ const formInfo = ref({
const orginData = [
{
ROWID: 'field_0',
fieldName: 'code',
fieldName: '代码',
description: '编码字段',
fieldType: 'varchar',
fieldLength: '10',
......@@ -303,7 +322,7 @@ const orginData = [
STATE: 'Running'
}, {
ROWID: 'field_1',
fieldName: 'name',
fieldName: '名称',
description: '编码名称',
fieldType: 'varchar',
fieldLength: '20',
......@@ -675,6 +694,7 @@ const setCodeOptions = () => {
}
const toolBtnClick = (btn, data) => {
console.log(formItems.value.length)
const type = btn.value
if (data) {
if (type.indexOf('add') > -1) {
......@@ -839,6 +859,7 @@ const tableSwitchChange = (val, scope, field) => {
}
const tableBtnClick = (scope, btn) => {
const type = btn.value;
const row = scope.row;
if (type == "edit") {
......@@ -874,7 +895,11 @@ const tableBtnClick = (scope, btn) => {
formTable.value.tableInfo.loading = false
drawerInfo.value.loading = false;
})
} else if (type == "delete") {
} else if (type === 'remove') {
const existIndex = formTableData.value.findIndex(s => s.ROWID == row.ROWID)
existIndex > -1 && formTableData.value.splice(existIndex, 1)
}
else if (type == "delete") {
currTableData.value = row;
tableInfo.value.loading = true
open("此操作将永久删除, 是否继续?", "warning");
......@@ -1091,7 +1116,13 @@ const loadDrawer = async () => {
})
formTable.value.tableInfo.fields = fields
formItems.value.forEach(item => {
if (item.field === 'bizState') {
item.default = 'Y'
} else if (item.field === 'typeCode') {
item.default = '1'
} else {
item.default = ''
}
item.disabled = false
})
formInfo.value.formInfo.items = formItems.value
......@@ -1343,6 +1374,11 @@ const scrollTable = (rowInfo) => {
const drawerBtnClick = (btn, info) => {
console.log('btn', btn, info)
console.log('table', formTable.value)
let uniqFieldNameList = Array.from(new Set(formTable.value.tableInfo.data.map(item => item.fieldName)))
if (uniqFieldNameList.length !== formTable.value.tableInfo.data.length) {
ElMessage.error('表结构字段名称需唯一,不允许重名')
return
}
let params = {
standardCodeFields: formTable.value.tableInfo.data.map(item => {
let obj = {
......
......@@ -273,6 +273,8 @@ const batching = (type) => {
// uploadSteps.value[0].cascaderInfo.options = dictionaryList.value
// }
uploadInfo.value.uploadInfo.steps = uploadSteps.value
uploadSetting.value.forEach(item => item.value = '')
sheetNameList.value = []
const content: any = [uploadInfo.value]
dialogInfo.value.contents = content
dialogInfo.value.visible = true
......@@ -515,17 +517,18 @@ onActivated(() => {
<Dialog :dialogInfo="dialogInfo" @btnClick="dialogBtnClick" @onUpload="onUpload" @uploadBtnClick="uploadBtnClick"
@cascaderChange="cascaderChange" @selectChange="selectChange">
<div>
<div class="title" style="color:#333">2、导入前请先导入文件的sheet与标准做对应</div>
<el-form :label-width="240" style="margin-top:20px">
<el-form-item label="全局变量">
<span>选择sheet页</span>
</el-form-item>
<el-form-item v-for="item in uploadSetting" :key="item.standardGuid" :label="item.standardName" required >
<el-select v-model="item.value" placeholder="请选择" style="width:200px" clearable>
<div class="title" style="color:#333;margin:20px 0 10px">2、导入前请先导入文件的sheet与标准做对应</div>
<el-table :data="uploadSetting">
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column label="代码名称" prop="standardName"></el-table-column>
<el-table-column label="选择sheet页">
<template #default="scope">
<el-select v-model="scope.row.value" placeholder="请选择" style="width:200px" clearable>
<el-option v-for="item,i in sheetNameList" :label="item" :value="item" :key="i"></el-option>
</el-select>
</el-form-item>
</el-form>
</template>
</el-table-column>
</el-table>
</div>
</Dialog>
</div>
......@@ -590,5 +593,11 @@ onActivated(() => {
padding: 0 16px;
height: calc(100% - 71px);
}
}
</style>
<style lang="scss">
.upload_panel_wrap .upload_panel .file_panel .file_item .file_btn {
word-break: keep-all;
}
</style>
......
......@@ -13,9 +13,10 @@ import DictFileds from './components/dictFileds.vue'
import useCatchStore from "@/store/modules/catch";
import { download } from '@/utils/common'
import { getParamsList } from '@/api/modules/dataAsset'
import { getStandardCodeList } from '@/api/modules/dataMetaService'
import { getMetaStandardTree } from '@/api/modules/dataMetaService'
import router from '@/router'
import { TableColumnWidth } from '@/utils/enum';
import StandardDialog from './components/standardDialog.vue'
const { proxy } = getCurrentInstance() as any;
......@@ -29,21 +30,23 @@ const treeInfo = ref({
queryValue: "",
queryPlaceholder: "请输入关键字搜索",
props: {
label: "label",
value: "value",
label: "standardName",
value: "guid",
isLeaf: "isLeaf",
},
lazy: true,
nodeKey: 'value',
expandedKey: ['01'],
currentNodeKey: '01',
// lazy: true,
nodeKey: 'guid',
expandedKey: [],
currentNodeKey: '',
data: [],
expandOnNodeClick: false,
loading: false,
currentObj: {}
currentObj: {},
editTreeItem: true,
className: 'tree-list'
})
function nodeClick (data) {
drawerInfo.value.visible = false
// drawerInfo.value.visible = false
const changeCont = () => {
nextTick(() => {
treeInfo.value.currentNodeKey = data.value
......@@ -85,6 +88,27 @@ function nodeClick (data) {
changeCont()
}
}
function treeCustomClick (node, type) {
console.log(node, type)
if (type === 'edit') {
// 编辑
standardDialog.type = 'edit'
standardDialog.guid = node.data.guid
standardDialog.visible = true
return
}
}
function getTree () {
getMetaStandardTree().then((res:any) => {
if (res.code === proxy.$passCode) {
let data = res.data || []
data.forEach(item => {
item.showEdit = true
})
treeInfo.value.data = data
}
})
}
const tableSearchInput = ref('')
const currTableData: any = ref<Object>({});
......@@ -262,15 +286,20 @@ const formInfo = ref({
// 元标准dialog
const standardDialog = reactive({
visible: false,
title: '新增元标准'
type: 'add',
guid: null
})
function openStandardDialog () {
standardDialog.visible = true
}
onBeforeMount(() => {
getTree()
})
</script>
<template>
<!-- <div class="container_wrap full flex standard">
<div class="container_wrap full flex standard">
<div class="aside_wrap">
<div class="aside_title">
元数据标准列表
......@@ -278,7 +307,11 @@ function openStandardDialog () {
<CirclePlus />
</el-icon>
</div>
<Tree ref="dictTreeRef" :treeInfo="treeInfo" @nodeClick="nodeClick" @loadNode="loadTreeNode"/>
<Tree ref="dictTreeRef" :treeInfo="treeInfo" @nodeClick="nodeClick" @itemMenuClick="treeCustomClick">
<template #default="{ node, data }">
{{ node.label }}
</template>
</Tree>
</div>
<div class="main_wrap">
<div class="table_tool_wrap">
......@@ -296,10 +329,14 @@ function openStandardDialog () {
@tablePageChange="tablePageChange" @tableSwitchBeforeChange="tableSwitchBeforeChange" />
</div>
</div>
<el-dialog v-model="standardDialog.visible" :title="standardDialog.title" width="700">
</el-dialog>
</div> -->
<StandardDialog
v-model="standardDialog.visible"
:standardOptions="treeInfo.data"
:type="standardDialog.type"
:guid="standardDialog.guid"
@success="getTree"
/>
</div>
</template>
<style lang="scss">
......@@ -324,7 +361,6 @@ function openStandardDialog () {
display: flex;
justify-content: space-between;
align-items: center;
}
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!