810307b0 by fanguang Committed by lihua

fix

1 parent 950a23fd
......@@ -35,13 +35,13 @@ const selectRowData = ref([])
const page = ref({
limit: 50,
curr: 1,
// sizes: [
// { label: "100", value: 100 },
// { label: "200", value: 200 },
// { label: "300", value: 300 },
// { label: "400", value: 400 },
// { label: "500", value: 500 },
// ],
sizes: [
{ label: "100", value: 100 },
{ label: "200", value: 200 },
{ label: "300", value: 300 },
{ label: "400", value: 400 },
{ label: "500", value: 500 },
],
});
const tableChunkData: any = ref([])
const tableData: any = ref([])
......@@ -51,7 +51,7 @@ const tableInfo: any = ref({
fields: [],
data: [],
page: {
type: "count",
type: "normal",
rows: 0,
...page.value,
},
......@@ -117,13 +117,14 @@ const dialogInfo = ref({
const getFirstPageData = () => {
page.value.curr = 1;
toSearch({})
}
const toSearch = (val: any, clear: boolean = false) => {
let params = {
pageIndex: 1,
pageSize: -1,
pageIndex: page.value.curr,
pageSize: page.value.limit,
standardGuid : standardGuid.value
}
getTableData(params);
......@@ -145,15 +146,18 @@ const tableSelectionChange = (val, tId) => {
const tablePageChange = (info) => {
page.value.curr = Number(info.curr);
if (page.value.limit != Number(info.limit)) {
page.value.limit = Number(info.limit);
chunkData()
} else {
tableData.value = tableChunkData.value[page.value.curr - 1]
tableInfo.value.data = tableData.value
tableInfo.value.page.limit = page.value.limit
tableInfo.value.page.curr = page.value.curr
}
page.value.limit = Number(info.limit);
toSearch({});
// page.value.curr = Number(info.curr);
// if (page.value.limit != Number(info.limit)) {
// page.value.limit = Number(info.limit);
// chunkData()
// } else {
// tableData.value = tableChunkData.value[page.value.curr - 1]
// tableInfo.value.data = tableData.value
// tableInfo.value.page.limit = page.value.limit
// tableInfo.value.page.curr = page.value.curr
// }
};
const toolBtnClick = (btn) => {
......
<route lang="yaml">
name: dictionary
name: metadataStandardCodetable
</route>
<script lang="ts" setup name="dictionary">
<script lang="ts" setup name="metadataStandardCodetable">
import { ref } from 'vue'
import { ElMessage, ElMessageBox } from "element-plus";
import { Search } from '@element-plus/icons-vue'
......@@ -39,6 +39,7 @@ import {
getNewDataTypeList
} from '@/api/modules/dataInventory';
import router from '@/router'
import { TableColumnWidth } from '@/utils/enum';
const { proxy } = getCurrentInstance() as any;
......@@ -119,7 +120,7 @@ const tableInfo: any = ref({
let status = scope.row.bizState;
return status == 'Y' ? '启用' : '停用';
} },
{ label: '创建时间', field: 'createTime', width: 140 }
{ label: '创建时间', field: 'createTime', width: TableColumnWidth }
],
data: [],
page: {
......@@ -130,9 +131,10 @@ const tableInfo: any = ref({
actionInfo: {
label: "操作",
type: "btn",
width: 92, //不要刚好90.缩小浏览器会因为小数点的差距而换行,
width: 132, //不要刚好90.缩小浏览器会因为小数点的差距而换行,
fixed: 'right',
btns: [
{ label: '查看', value: 'detail'},
{ label: "编辑", value: "edit" },
{ label: "删除", value: "delete" },
],
......@@ -146,89 +148,6 @@ const orginOptions = [
{ label: 'name', value: 'name' },
]
let codeOptions = ref([])
const orginItems = [
{
label: '标准类型',
type: 'select',
placeholder: '请选择',
field: 'standardTypeCode',
default: '',
options: standardOptions,
clearable: true,
required: true
}
, {
label: '字典英文名',
type: 'input',
maxlength: 20,
placeholder: '请输入',
field: 'enName',
clearable: true,
required: true,
disabled: false
}, {
label: '排序',
type: 'input',
placeholder: '请输入',
field: 'orderNum',
maxlength: 6,
clearable: true,
required: true,
visible: true,
}, {
label: '字典类型',
type: 'radio-panel',
placeholder: '',
field: 'dictionaryType',
default: 1,
options: [
{ label: '列表结构', value: 1 },
{ label: '层级结构', value: 2 }
],
children: [
{
label: '编码字段',
type: 'select',
placeholder: '请输入',
field: 'codeColumn',
default: '',
options: [],
clearable: true,
required: true
}, {
label: '编码名称',
type: 'select',
placeholder: '请输入',
field: 'codeName',
default: '',
options: [],
clearable: true,
required: true
}, {
label: '顶级节点值',
type: 'input',
placeholder: '请输入',
field: 'topNodeValue',
clearable: true,
required: true,
visible: false
}, {
label: '路径',
type: 'input',
placeholder: '请输入',
field: 'path',
clearable: true,
required: true,
block: true,
visible: false
}
],
clearable: true,
required: false,
block: true,
visible: true,
},
]
const formItems: any = ref([
{
label: '标准类型',
......@@ -448,7 +367,7 @@ const formTable = ref({
},
tableTool: {
col: 'float-right',
visible: true,
visible: false,
btns: [
{ label: "新增行", value: "add-row", type: 'primary' },
{ label: "批量删除", value: "remove_batch" },
......@@ -569,7 +488,7 @@ const drawerInfo: any = ref({
footer: {
btns: [
{ type: 'default', label: '取消', value: 'cancel' },
{ type: 'primary', label: '保存', value: 'submit' },
{ type: 'primary', label: '保存', value: 'submit', visible: true },
{ type: 'primary', label: '保存并添加数据', value: 'submit', visible: true },
]
},
......@@ -941,17 +860,24 @@ const tableBtnClick = (scope, btn) => {
if (type == "edit" || type == 'detail') {
fieldTableInfo.value.tableInfo.fields = []
fieldTableInfo.value.tableInfo.data = []
drawerInfo.value.header.title = type == 'edit' ? "编辑标准代码" : "数据字典详情";
drawerInfo.value.header.title = type == 'edit' ? "编辑标准代码" : "标准代码详情";
drawerInfo.value.modalClass = type == 'edit' ? '' : 'wrap_width_auto'
drawerInfo.value.type = type
drawerInfo.value.footer.btns.forEach(item => {
if (item.value === 'submit') {
item.visible = type === 'detail' ? false : true
}
})
drawerInfo.value.visible = true;
drawerInfo.value.loading = true;
formTable.value.tableInfo.actionInfo.show = type === 'detail' ? false : true
formTable.value.tableTool.visible = type === 'detail' ? false : true
formTable.value.tableInfo.loading = true
getStandardCodeDetail(row.guid).then((res: any) => {
if (res.code == proxy.$passCode && res.data) {
let data = res.data
currTableData.value = data;
setDetailInfo()
setDetailInfo(type)
} else {
ElMessage({
type: "error",
......@@ -970,7 +896,7 @@ const tableBtnClick = (scope, btn) => {
open("此操作将永久删除, 是否继续?", "warning");
tableInfo.value.loading = false
}
};
}
const checkDelete = (isBatch: any = false) => {
if (drawerInfo.value.visible) {
......@@ -1307,10 +1233,12 @@ function loadTreeNode (node, resolve) {
}
// 设置详情信息
const setDetailInfo = () => {
const setDetailInfo = (type) => {
console.log('type', type)
const row = JSON.parse(JSON.stringify(currTableData.value))
formItems.value.forEach(item => {
item.default = row[item.field] || ''
item.disabled = type === 'detail' ? true : false
})
formInfo.value.formInfo.items = formItems.value
formTableData.value = row.standardCodeFields.map(item => {
......@@ -1328,13 +1256,15 @@ const setDetailInfo = () => {
formTable.value.tableInfo.fields = fields
formTable.value.tableInfo.data = formTableData.value
formTable.value.tableInfo.editInfo = JSON.parse(JSON.stringify(editTableInfo.value))
formTable.value.tableInfo.readonly = false
formTable.value.tableInfo.readonly = type === 'detail' ? true : false
formTable.value.tableInfo.multiple = true
formTable.value.tableInfo.actionInfo.show = true
formTable.value.tableTool.visible = true
// formTable.value.tableInfo.actionInfo.show = true
// formTable.value.tableTool.visible = true
drawerInfo.value.container.contents = contents.value['add']
drawerInfo.value.visible = true
setCodeOptions()
}
......@@ -1416,56 +1346,12 @@ const radioGroupChange = async (val, info) => {
// setGroup()
if (val == 1) {
// 列表结构
formItems.value.find(v => v.field === 'codeFields')['visible'] = true
formItems.value.find(v => v.field === 'codeFieldName')['visible'] = true
formItems.value.find(v => v.field === 'hierarchy')['visible'] = false
} else {
formItems.value.find(v => v.field === 'codeFields')['visible'] = false
formItems.value.find(v => v.field === 'codeFieldName')['visible'] = false
formItems.value.find(v => v.field === 'hierarchy')['visible'] = true
}
}
// 切换结构类型 设置选项显隐
const setGroup = () => {
let dictionaryOpts = formItems.value.at(-1).children
if (dictionaryType.value == 1) {
dictionaryOpts[2].visible = false
dictionaryOpts[3].visible = false
} else if (dictionaryType.value == 2) {
dictionaryOpts[2].visible = false
dictionaryOpts[3].block = false
dictionaryOpts[3].visible = true
} else if (dictionaryType.value == 3) {
dictionaryOpts[2].visible = true
dictionaryOpts[3].block = true
dictionaryOpts[3].visible = true
} else if (dictionaryType.value == 4) {
dictionaryOpts[2].visible = false
dictionaryOpts[3].block = true
dictionaryOpts[3].visible = true
}
formInfo.value.formInfo.items = formItems.value
}
onActivated(() => {
// getCodeRuleData();
// let guid = cacheStore.getCatch('dictionaryGuid');
// if (guid) {
// nextTick(() => {
// if (treePromise.value) {
// treePromise.value.then(() => {
// nodeClick({ guid: guid, dictionaryType: '1', type: 2 });
// cacheStore.setCatch('dictionaryGuid', null);
// });
// } else {
// nodeClick({ guid: guid, type: 1 });
// cacheStore.setCatch('dictionaryGuid', null);
// }
// });
// }
})
onBeforeMount(() => {
// getDataType()
getTreeData()
......
<route lang="yaml">
name: importFile
name: metadataStandardImport
</route>
<script lang="ts" setup name="importFile">
<script lang="ts" setup name="metadataStandardImport">
import { ref } from "vue";
import { useRoute, useRouter } from "vue-router"
import useUserStore from "@/store/modules/user";
......@@ -516,7 +516,7 @@ onActivated(() => {
@cascaderChange="cascaderChange" @selectChange="selectChange">
<div>
<div class="title" style="color:#333">2、导入前请先导入文件的sheet与标准做对应</div>
<el-form :label-width="120" style="margin-top:20px">
<el-form :label-width="240" style="margin-top:20px">
<el-form-item label="全局变量">
<span>选择sheet页</span>
</el-form-item>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!