diff --git a/src/api/base/extendfield/extendFieldApi.js b/src/api/base/extendfield/extendFieldApi.js index 05b722c..93519ef 100644 --- a/src/api/base/extendfield/extendFieldApi.js +++ b/src/api/base/extendfield/extendFieldApi.js @@ -20,5 +20,9 @@ export default { // 获取扩展字段配置详情 extendFieldDetail(data) { return request('detail', data, 'get') + }, + // 获取扩展字段配置列表(根据分类) + extendFieldTypeList(data) { + return request('typeList', data, 'get') } } diff --git a/src/components/DynamicTree/index.vue b/src/components/DynamicTree/index.vue index 2e1b9bc..3beae41 100644 --- a/src/components/DynamicTree/index.vue +++ b/src/components/DynamicTree/index.vue @@ -1,43 +1,50 @@ @@ -84,7 +91,7 @@ } }) - const emits = defineEmits('selectTree', 'delTree') + const emit = defineEmits(['selectTree', 'delTree']) const tool = [ { @@ -112,12 +119,20 @@ // 树结构 const expandedKeys = ref() const selectedKeys = ref([]) - const treeData = ref([]) + const localLoading = ref(false) + const treeData = ref([ + { + id: 0, + parentId: '-1', + name: '顶级', + children: '' + } + ]) let treeRow = {} const handleTreeClick = (selectedKeys, event) => { treeRow = event.node - emits('selectTree', treeRow) + emit('selectTree', treeRow) } const handleAddTree = () => { @@ -141,11 +156,13 @@ const loadTreeData = async () => { try { + localLoading.value = true const treeRes = await props.apiModel.getTree() + console.log(treeRes, 'treeRes') if (Array.isArray(treeRes)) { - treeData.value = treeRes + treeData.value[0].children = treeRes } else { - treeData.value = [] + treeData.value[0].children = [] } if (selectedKeys.value.length > 0) { @@ -157,7 +174,12 @@ if (treeRow.id) { treeRow = [] } + + setTimeout(() => { + localLoading.value = false + }, 800) } catch (e) { + localLoading.value = false message.error('获取树结构数据失败:' + e) console.error('获取树结构数据失败:' + e) } diff --git a/src/components/OperationalInformation/index.vue b/src/components/OperationalInformation/index.vue index f8ce042..9903a9f 100644 --- a/src/components/OperationalInformation/index.vue +++ b/src/components/OperationalInformation/index.vue @@ -62,7 +62,8 @@ detailDataProps.value = props.detailData }, { - immediate: true + immediate: true, + deep: true } ) diff --git a/src/components/XnPageSelect/README.assets/鍒嗛〉涓嬫媺鏌ヨ灞曠ず.gif b/src/components/XnPageSelect/README.assets/鍒嗛〉涓嬫媺鏌ヨ灞曠ず.gif new file mode 100644 index 0000000..be20102 Binary files /dev/null and b/src/components/XnPageSelect/README.assets/鍒嗛〉涓嬫媺鏌ヨ灞曠ず.gif differ diff --git a/src/hook/useFormHandler.js b/src/hook/useFormHandler.js index 2b5c466..2fd29e4 100644 --- a/src/hook/useFormHandler.js +++ b/src/hook/useFormHandler.js @@ -13,6 +13,7 @@ export default function useFormHandler(formItems, api) { const state = reactive({ PAGE_TYPE: '' }) + let detailData = reactive({}) // 初始化表单数据对象 let formData = reactive({}) @@ -84,8 +85,8 @@ export default function useFormHandler(formItems, api) { * 处理返回操作,返回上一级页面并关闭当前标签页。 */ const handleBack = () => { + useTabs.close(route) router.go(-1) // 优化为通用的返回上一页操作 - useTabs.close() } /** @@ -98,6 +99,7 @@ export default function useFormHandler(formItems, api) { if (pageType && pageType !== 'ADD') { try { const res = await api.getDetail({ id: route.query.id }) + // 根据返回的详情数据初始化表单数据 for (let key in formData) { if (res[key] !== undefined) { @@ -117,6 +119,7 @@ export default function useFormHandler(formItems, api) { formData, submitLoading, formRefs, + detailData, onSubmit, handleBack, fetchData diff --git a/src/layout/components/tags.vue b/src/layout/components/tags.vue index f2627cf..16abe77 100644 --- a/src/layout/components/tags.vue +++ b/src/layout/components/tags.vue @@ -52,7 +52,7 @@ - + @@ -94,7 +94,7 @@ }) watch(route, (to) => { addViewTags(to) - activeKey.value = to.fullPath + activeKey.value = to.path }) watch(layoutTagsOpen, () => { // closeOtherCacheTabs() @@ -107,10 +107,10 @@ }) // 增加tag const addViewTags = (to) => { - activeKey.value = to.fullPath - if (to.name && !to.meta.fullpage) { + activeKey.value = to.path + if (to.name) { vStore.pushViewTags(to) - kStore.pushKeepLive(to.name) + // kStore.pushKeepLive(to.name) } if (tagList.value.length - 1 > maxTabs.value) { const firstTag = tagList.value[1] @@ -158,9 +158,9 @@ const nowTag = getCurrentTag() // 判断是否当前路由,否的话跳转 // eslint-disable-next-line eqeqeq - if (route.fullPath !== nowTag.fullPath) { + if (route.path !== nowTag.path) { router.push({ - path: nowTag.fullPath, + path: nowTag.path, query: nowTag.query }) } @@ -189,16 +189,16 @@ const nowTag = getCurrentTag() // 判断是否当前路由,否的话跳转 // eslint-disable-next-line eqeqeq - if (route.fullPath !== nowTag.fullPath) { + if (route.path !== nowTag.path) { router.push({ - path: nowTag.fullPath, + path: nowTag.path, query: nowTag.query }) } const tags = [...tagList.value] tags.forEach((tag) => { // eslint-disable-next-line eqeqeq - if ((tag.meta && tag.meta.affix) || nowTag.fullPath === tag.fullPath) { + if ((tag.meta && tag.meta.affix) || nowTag.path === tag.path) { return true } else { closeSelectedTag(tag, false) @@ -219,9 +219,9 @@ const nowTag = getCurrentTag() // 判断是否当前路由,否的话跳转 // eslint-disable-next-line eqeqeq - if (route.fullPath !== nowTag.fullPath) { + if (route.path !== nowTag.path) { router.push({ - path: nowTag.fullPath, + path: nowTag.path, query: nowTag.query }) } @@ -265,7 +265,7 @@ const onTabRemove = (tabKey, action) => { if (action === 'remove') { - const tag = tagList.value.find((tag) => tag.fullPath === tabKey) + const tag = tagList.value.find((tag) => tag.path === tabKey) closeSelectedTag(tag) } } @@ -319,9 +319,7 @@ background: none; height: 40px; line-height: 40px; - transition: - background-color 0.3s, - color 0.3s; + transition: background-color 0.3s, color 0.3s; padding: 0 16px; border-radius: 0; border: none; @@ -442,9 +440,7 @@ position: relative; z-index: 1; border-radius: 10px 10px 0 0 !important; - box-shadow: - 12px 15px 0 0 var(--primary-1), - -12px 15px 0 0 var(--primary-1); + box-shadow: 12px 15px 0 0 var(--primary-1), -12px 15px 0 0 var(--primary-1); } .snowy-radius .ant-tabs-tab-active::before { content: ''; diff --git a/src/views/basicData/client/detail/index.vue b/src/views/basicData/client/detail/index.vue index bcb979f..dfe8cfa 100644 --- a/src/views/basicData/client/detail/index.vue +++ b/src/views/basicData/client/detail/index.vue @@ -70,6 +70,9 @@ + + + @@ -83,8 +86,8 @@ import useFormHandler from '@/hook/useFormHandler' import tool from '@/utils/tool' import { useRoute } from 'vue-router' - const route = useRoute() import cityOptions from '@/utils/cityOptions' + const route = useRoute() const formRules = { name: [required('请输入名称')], @@ -92,6 +95,7 @@ appid: [required('请输入AppID')], secret: [required('请输入AppSecret')] } + let detailData = reactive({}) // 级联选择 const onCascaderChange = (value) => { @@ -321,9 +325,12 @@ } onMounted(async () => { + console.log(1) formRefs.value = [formRef1.value, formRef2.value] fetchData(route.query.type).then((res) => { if (res) { + detailData = res + formData.provinceName = [res.province, res.city, res.county] customerApi @@ -350,7 +357,6 @@ }) // 客户分类 - customerCategoryApi .customerCategoryTree({ enabledState: 'ENABLE' diff --git a/src/views/basicData/client/formItems/index.js b/src/views/basicData/client/formItems/index.js new file mode 100644 index 0000000..34f9157 --- /dev/null +++ b/src/views/basicData/client/formItems/index.js @@ -0,0 +1,95 @@ +import tool from '@/utils/tool' +import { required } from '@/utils/formRules' + +export const officialAccountFormItems = [ + { + label: '类型:', + name: 'type', + type: 'a-select', + span: 8, + attrs: { + placeholder: '请选择类型', + options: tool.dictList('OFFICIAL_ACCOUNT_TYPE') + } + }, + { + label: '名称:', + name: 'name', + type: 'a-input', + span: 8, + rules: [required('请输入名称')], + attrs: { + placeholder: '请输入名称', + allowClear: true + } + }, + { + label: '可用状态:', + name: 'enabledState', + type: 'a-select', + span: 8, + attrs: { + placeholder: '请选择可用状态', + options: tool.dictList('COMMON_STATUS') + }, + defaultValue: 'ENABLE' + }, + { + label: '备注:', + name: 'remarks', + type: 'a-textarea', + span: 24, + attrs: { + placeholder: '请输入备注', + allowClear: true + } + } +] + +export const basicInfoFormItems = [ + { + label: 'AppID:', + name: 'appid', + type: 'a-input', + attrs: { + placeholder: '请输入AppID', + allowClear: true + } + }, + { + label: 'AppSecret:', + name: 'secret', + type: 'a-input', + attrs: { + placeholder: '请输入AppSecret', + allowClear: true + } + }, + { + label: '字符串编码格式:', + name: 'encodingFormat', + type: 'a-input', + attrs: { + placeholder: '请输入字符串编码格式', + allowClear: true + } + }, + { + label: '校验码:', + name: 'token', + type: 'a-input', + attrs: { + placeholder: '请输入校验码', + allowClear: true + } + }, + { + label: '签名方式:', + name: 'aesKey', + type: 'a-input', + attrs: { + placeholder: '请输入签名方式', + allowClear: true + } + } +] diff --git a/src/views/basicData/client/index.vue b/src/views/basicData/client/index.vue index 3e22b23..c85db22 100644 --- a/src/views/basicData/client/index.vue +++ b/src/views/basicData/client/index.vue @@ -129,7 +129,6 @@ - @@ -142,7 +141,7 @@ - diff --git a/src/views/basicData/stash/detail/index.vue b/src/views/basicData/stash/detail/index.vue index 3f185ae..afc6748 100644 --- a/src/views/basicData/stash/detail/index.vue +++ b/src/views/basicData/stash/detail/index.vue @@ -152,7 +152,7 @@ span: 6, attrs: { placeholder: '请选择上游仓库', - options: [], + treeData: [], fieldNames: { children: 'children', label: 'name', @@ -236,13 +236,18 @@ }) const sysStoreTreeList = await sysStoreApi.sysStoreTree() - if (Array.isArray(sysStoreTreeList)) { - officialAccountFormItems.forEach((item) => { - if (item.name === 'parentId') { - item.attrs.options = sysStoreTreeList - } - }) - } + officialAccountFormItems.forEach((item) => { + if (item.name === 'parentId') { + item.attrs.treeData = [ + { + id: 0, + parentId: '-1', + name: '顶级', + children: sysStoreTreeList || [] + } + ] + } + }) }) let activeKey = ref('1') diff --git a/src/views/basicData/stash/index.vue b/src/views/basicData/stash/index.vue index bcedb0c..0305f9d 100644 --- a/src/views/basicData/stash/index.vue +++ b/src/views/basicData/stash/index.vue @@ -30,93 +30,115 @@ - - - + + + + @@ -192,4 +214,15 @@ stashColumn, ['sysStoreEdit', 'sysStoreDelete'] ) + + const dynamicTreeRef = ref(null) + + const onSelectTree = (value) => { + searchFormState.value.parentId = value.id + tableRef.value.refresh() + } + + onMounted(() => { + dynamicTreeRef.value.loadTreeData() + }) diff --git a/src/views/basicData/tissue/detail/TissueForm.vue b/src/views/basicData/tissue/detail/TissueForm.vue index 5e5ba66..2d7e9ca 100644 --- a/src/views/basicData/tissue/detail/TissueForm.vue +++ b/src/views/basicData/tissue/detail/TissueForm.vue @@ -1,14 +1,14 @@