diff --git a/src/assets/js/constant.js b/src/assets/js/constant.js index 8c426db..5fd8420 100644 --- a/src/assets/js/constant.js +++ b/src/assets/js/constant.js @@ -1,6 +1,11 @@ // 将常用的值储存成常量,防止重复使用写错 export const WHETHER_LIST = [ - { id: "0", name: "否" }, - { id: "1", name: "是" }, + { id: 0, name: "否" }, + { id: 1, name: "是" }, +]; + +export const STATUS_LIST = [ + { name: "正常", id: 1 }, + { name: "关停", id: 2 }, ]; diff --git a/src/assets/js/regular.js b/src/assets/js/regular.js index f798076..17a6307 100644 --- a/src/assets/js/regular.js +++ b/src/assets/js/regular.js @@ -1,14 +1,41 @@ +/** + * 匹配中国手机号码,可包含国家代码86,支持各种运营商号段。 + */ export const PHONE = /^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-7|9])|(?:5[0-3|5-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[1|8|9]))\d{8}$/; + +/** + * 匹配中国大陆的统一社会信用代码。 + */ export const UNIFIED_SOCIAL_CREDIT_CODE = /^[0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}$/; + +/** + * 匹配中国大陆的身份证号码,包括15位和18位号码,并验证最后一位校验码。 + */ export const ID_NUMBER = /^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/; + +/** + * 匹配中国大陆的移动电话号码,不包含国家代码。 + */ export const MOBILE_PHONE = /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/; + +/** + * 匹配浮点数,允许整数、一位或两位小数,以及零的情况。 + */ export const FLOATING_POINT_NUMBER = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/; + +/** + * 匹配中国大陆的车牌号码。 + */ export const LICENSE_PLATE_NUMBER = /^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1})$/; + +/** + * 匹配强密码,要求至少8个字符,包含大小写字母、数字和特殊字符。 + */ export const STRONG_PASSWORD = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z\d]).{8,}$/; diff --git a/src/components/form_builder/form_items_renderer.vue b/src/components/form_builder/form_items_renderer.vue new file mode 100644 index 0000000..22f245c --- /dev/null +++ b/src/components/form_builder/form_items_renderer.vue @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + {{ item[option.labelKey] || item["name"] }} + + + + + {{ item[option.labelKey] || item["name"] }} + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/form_builder/index.vue b/src/components/form_builder/index.vue new file mode 100644 index 0000000..94b69ae --- /dev/null +++ b/src/components/form_builder/index.vue @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + diff --git a/src/components/search/index.vue b/src/components/search/index.vue index 3fadeb9..e34feef 100644 --- a/src/components/search/index.vue +++ b/src/components/search/index.vue @@ -5,7 +5,21 @@ @submit.prevent="emits('submit')" > - + + + + + + + + + + 搜索 @@ -46,19 +60,24 @@ diff --git a/src/components/table/index.vue b/src/components/table/index.vue index 5b0a986..069fca1 100644 --- a/src/components/table/index.vue +++ b/src/components/table/index.vue @@ -69,86 +69,31 @@ defineOptions({ name: "AppTable", }); const props = defineProps({ - data: { - type: Array, - required: true, - }, - showPagination: { - type: Boolean, - default: true, - }, - showIndex: { - type: Boolean, - default: true, - }, - showSelection: { - type: Boolean, - default: false, - }, - stripe: { - type: Boolean, - default: true, - }, - border: { - type: Boolean, - default: true, - }, - showHeader: { - type: Boolean, - default: true, - }, - highlightCurrentRow: { - type: Boolean, - default: false, - }, - showSummary: { - type: Boolean, - default: false, - }, - defaultExpandAll: { - type: Boolean, - default: false, - }, - rowKey: { - type: [String, Function], - }, - maxHeight: { - type: [String, Number], - }, - height: { - type: [String, Number], - }, - rowClassName: { - type: Function, - }, - rowStyle: { - type: Function, - }, - summaryMethod: { - type: Function, - }, - spanMethod: { - type: Function, - }, - selectable: { - type: Function, - }, + data: { type: Array, required: true }, + showPagination: { type: Boolean, default: true }, + showIndex: { type: Boolean, default: true }, + showSelection: { type: Boolean, default: false }, + stripe: { type: Boolean, default: true }, + border: { type: Boolean, default: true }, + showHeader: { type: Boolean, default: true }, + highlightCurrentRow: { type: Boolean, default: false }, + showSummary: { type: Boolean, default: false }, + defaultExpandAll: { type: Boolean, default: false }, + rowKey: { type: [String, Function] }, + maxHeight: { type: [String, Number] }, + height: { type: [String, Number] }, + rowClassName: { type: Function }, + rowStyle: { type: Function }, + summaryMethod: { type: Function }, + spanMethod: { type: Function }, + selectable: { type: Function }, treeProps: { type: Object, default: () => ({ hasChildren: "hasChildren", children: "children" }), }, - headerCellStyle: { - type: Object, - default: () => ({}), - }, - cellStyle: { - type: [Object, Function], - default: () => ({}), - }, - showOverflowTooltip: { - type: Boolean, - default: true, - }, + headerCellStyle: { type: Object, default: () => ({}) }, + cellStyle: { type: [Object, Function], default: () => ({}) }, + showOverflowTooltip: { type: Boolean, default: true }, }); const pagination = defineModel("pagination", { type: Object, diff --git a/src/data_dictionary/data_dictionary.js b/src/data_dictionary/data_dictionary.js new file mode 100644 index 0000000..d80bea9 --- /dev/null +++ b/src/data_dictionary/data_dictionary.js @@ -0,0 +1,29 @@ +import { + getDataDictionariesList, + getDepartmentTree, +} from "@/request/data_dictionary.js"; + +// 部门 +export const appFnGetDepartmentTree = async (params) => { + const { deptTree } = await getDepartmentTree(params); + return deptTree; +}; +// 无法确定parentId的数据字典 +export const appFnGetDataDictionary = async (parentId) => { + const { dictionariesList } = await getDataDictionariesList(parentId); + return dictionariesList; +}; +// 导航栏 +export const appFnGetMenuNavList = async () => { + const { dictionariesList } = await getDataDictionariesList({ + parentId: "7b2cf146798280ecf8f4dfbf8c4f59d8", + }); + return dictionariesList; +}; +// 获取行业 +export const appFnGetSectorList = async () => { + const { dictionariesList } = await getDataDictionariesList({ + parentId: "f2598ba72e864eadabf0ca4b664d26b9", + }); + return dictionariesList; +}; diff --git a/src/hooks/useListData.js b/src/hooks/useListData.js index de17606..c77769d 100644 --- a/src/hooks/useListData.js +++ b/src/hooks/useListData.js @@ -22,11 +22,11 @@ const verificationParameter = (api, options) => { ) throw new Error("options.callback必须是一个函数"); if ( - options.beforeGetData && - getDataType(options.beforeGetData) !== "Function" && - getDataType(options.beforeGetData) !== "AsyncFunction" + options.before && + getDataType(options.before) !== "Function" && + getDataType(options.before) !== "AsyncFunction" ) - throw new Error("options.beforeGetData必须是一个函数"); + throw new Error("options.before必须是一个函数"); if ( options.defaultSearchForm && getDataType(options.defaultSearchForm) !== "Object" @@ -53,6 +53,8 @@ const verificationParameter = (api, options) => { getDataType(options.tabsActiveName) !== "String" ) throw new Error("options.tabsActiveName必须是一个字符串"); + if (options.apiType && getDataType(options.apiType) !== "String") + throw new Error("options.apiType必须是一个字符串"); }; const getOptionParams = (params) => { @@ -65,11 +67,20 @@ const getOptionParams = (params) => { } }; +const getBeforeParams = (before, params) => { + if (before) { + const paramsValue = before(JSON.parse(JSON.stringify(params))); + if (getDataType(paramsValue) !== "Object") + throw new Error("options.before必须存在返回值并且必须是一个对象"); + else return paramsValue; + } +}; + /** * @param {Function} api - 接口请求函数,用于获取列表数据 * @param {Object} [options] - 配置项(可选) * @param {Function} [options.callback] - 数据获取完成后的回调函数 - * @param {Function} [options.beforeGetData] - 请求前执行的钩子函数 + * @param {Function} [options.before] - 请求前执行的钩子函数,必须返回一个对象 * @param {Object|Function} [options.params] - 额外的请求参数,可以是对象或返回对象的函数 * @param {Object} [options.defaultSearchForm] - 搜索表单默认值 * @param {boolean} [options.immediate=true] - 是否立即执行接口请求 @@ -78,6 +89,7 @@ const getOptionParams = (params) => { * @param {boolean} [options.clearSelection=true] - 调用 resetPagination 时是否清空表格选择项 * @param {boolean} [options.isStorageQueryCriteria=true] - 是否缓存当前查询条件 * @param {string} [options.tabsActiveName] - 当存在 Tabs 组件时,当前激活的 tab 名称,用于区分查询缓存 + * @param {string} [options.apiType] - 多个路由指向一个页面时,用于区分调用的api名称 * @return {Object} 返回对象包含以下属性:list 表格数据,pagination 分页数据,searchForm 搜索表单数据,tableRef 表格实例,getData 获取数据函数,resetPagination 重置分页函数 * @returns {Object} 返回对象包含以下属性: * - [list] {Ref} 表格数据,使用 Vue 的 ref 包裹的数组 @@ -101,27 +113,26 @@ export default function useListData(api, options = {}) { const queryCriteria = getQueryCriteria(); const pagination = ref(queryCriteria.pagination || defaultPagination); const searchForm = ref(JSON.parse(JSON.stringify(defaultSearchForm))); - let beforeGetDataParams = {}; const tableRef = ref(null); const getData = async () => { - if (options.beforeGetData) { - beforeGetDataParams = JSON.parse( - JSON.stringify(queryCriteria.searchForm || searchForm.value) - ); - options.beforeGetData(beforeGetDataParams); - } - const resData = await api({ - ...(usePagination - ? { - curPage: pagination.value.currentPage, - limit: pagination.value.pageSize, - } - : {}), - ...searchForm.value, - ...beforeGetDataParams, - ...(queryCriteria.searchForm || {}), - ...(getOptionParams(options.params) || {}), - }); + const resData = await api( + { + ...(usePagination + ? { + curPage: pagination.value.currentPage, + limit: pagination.value.pageSize, + } + : {}), + ...searchForm.value, + ...(queryCriteria.searchForm || {}), + ...(getBeforeParams( + options.before, + queryCriteria.searchForm || searchForm.value + ) || {}), + ...(getOptionParams(options.params) || {}), + }, + options.apiType ? options.apiType : undefined + ); if (usePagination) { if (resData.page[key]) list.value = resData.page[key]; else list.value = resData[key] || resData.varList; diff --git a/src/request/data_dictionary.js b/src/request/data_dictionary.js index fb5d30d..2599aec 100644 --- a/src/request/data_dictionary.js +++ b/src/request/data_dictionary.js @@ -12,3 +12,6 @@ export const getDataDictionariesListTree = (params) => // 部门树 export const getDepartmentListTree = (params) => getRequest("/sysdepartment/listTree", params); +// 属地 +export const getAreaListTree = (params) => + postRequest("/sys/dictionaries/area", params); diff --git a/src/request/data_directory.js b/src/request/data_directory.js new file mode 100644 index 0000000..d58c560 --- /dev/null +++ b/src/request/data_directory.js @@ -0,0 +1,17 @@ +import { postRequest } from "./axios"; + +// 获取企业信息-分页 +export const getDataList = (params, apiType) => + postRequest(`/${apiType}/listPage`, params); + +// 获取记录信息-分页 +export const getRecordList = (params, apiType) => + postRequest(`/${apiType}/record/listPage`, params); + +// 记录信息 - 删除 +export const setRecordDelete = (params, apiType) => + postRequest(`/${apiType}/record/delete`, params); + +// 记录信息 - 详情 +export const getRecordDetail = (params, apiType) => + postRequest(`/${apiType}/record/detail`, params); diff --git a/src/request/database.js b/src/request/database.js new file mode 100644 index 0000000..8cd818a --- /dev/null +++ b/src/request/database.js @@ -0,0 +1,81 @@ +import { postRequest } from "./axios"; + +// 获取上级平台管理信息-分页 +export const getBusThirdPlatformList = (params) => + postRequest("/busThirdPlatform/listPage", params); + +// 上级平台管理信息-保存 +export const setBusThirdPlatformAdd = (params) => + postRequest("/busThirdPlatform/save", params); + +// 上级平台管理信息-修改 +export const setBusThirdPlatformUpdate = (params) => + postRequest("/busThirdPlatform/update", params); + +// 上级平台管理信息 - 删除 +export const setBusThirdPlatformDelete = (params) => + postRequest("/busThirdPlatform/delete", params); + +// 上级平台管理信息 - 详情 +export const getBusThirdPlatform = (params) => + postRequest("/busThirdPlatform/detail", params); + +// 数据目录项 +export const getBusDataItemsMenuList = (params) => + postRequest("/busDataItems/menuList", params); + +// 根据菜单id查询所有数据项 +export const getFindByMenuId = (params) => + postRequest("/busDataItems/findByMenuId", params); + +// 数据项保存 +export const setDataSave = (params) => + postRequest("/busThirdPlatform/dataSave", params); + +// 获取服务平台管理信息-分页 +export const getBusServicePlatformList = (params) => + postRequest("/busServicePlatform/listPage", params); + +// 服务平台管理信息-保存 +export const setBusServicePlatformAdd = (params) => + postRequest("/busServicePlatform/save", params); + +// 服务平台管理信息-修改 +export const setBusServicePlatformUpdate = (params) => + postRequest("/busServicePlatform/update", params); + +// 服务平台管理信息 - 删除 +export const setBusServicePlatformDelete = (params) => + postRequest("/busServicePlatform/delete", params); + +// 服务平台管理信息 - 详情 +export const getBusServicePlatform = (params) => + postRequest("/busServicePlatform/detail", params); + +// 获取所有上级平台 +export const getBusThirdPlatformListAll = (params) => + postRequest("/busThirdPlatform/listAll", params); + +// 获取对接企业管理信息-分页 +export const getBusCompanyInfoList = (params) => + postRequest("/busCompanyInfo/listPage", params); + +// 对接企业管理信息-保存 +export const setBusCompanyInfoAdd = (params) => + postRequest("/busCompanyInfo/save", params); + +// 对接企业管理信息-修改 +export const setBusCompanyInfoUpdate = (params) => + postRequest("/busCompanyInfo/update", params); + +// 对接企业管理信息 - 删除 +export const setBusCompanyInfoDelete = (params) => + postRequest("/busCompanyInfo/delete", params); + +// 对接企业管理信息 - 详情 +export const getBusCompanyInfo = (params) => + postRequest("/busCompanyInfo/detail", params); + +// 获取所有服务平台 +export const getBusServicePlatformListAll = (params) => + postRequest("/busServicePlatform/listAll", params); diff --git a/src/views/data_directory/data_risk_events/index.vue b/src/views/data_directory/data_risk_events/index.vue new file mode 100644 index 0000000..50b01ab --- /dev/null +++ b/src/views/data_directory/data_risk_events/index.vue @@ -0,0 +1,93 @@ + + + + + + + + + + + + + {{ translationStatus(row.pushStatus, pushOptions) }} + + + + + {{ translationStatus(row.receiveStatus, receiveOptions) }} + + + + + + 推进记录信息 + + + + + + + + + + diff --git a/src/views/data_directory/data_risk_events/records.vue b/src/views/data_directory/data_risk_events/records.vue new file mode 100644 index 0000000..b1e30e0 --- /dev/null +++ b/src/views/data_directory/data_risk_events/records.vue @@ -0,0 +1,107 @@ + + + + + + + + + + {{ translationStatus(row.receiveStatus, receiveOptions) }} + + + + + + + {{ translationStatus(row.pushStatus, pushOptions) }} + + + + + + 详情信息 + + + 删除 + + + + + + + + + + diff --git a/src/views/data_directory/data_risk_events/records_detail.vue b/src/views/data_directory/data_risk_events/records_detail.vue new file mode 100644 index 0000000..a5ef049 --- /dev/null +++ b/src/views/data_directory/data_risk_events/records_detail.vue @@ -0,0 +1,105 @@ + + + + + 请求信息 + + { + + {{ key }} : + {{ value }} + + } + + {{ requestData }} + + + + 响应信息 + + { + + {{ key }} : + {{ value }} + + } + + {{ responseData }} + + + + + + + diff --git a/src/views/data_directory/data_risk_unit/index.vue b/src/views/data_directory/data_risk_unit/index.vue new file mode 100644 index 0000000..1415616 --- /dev/null +++ b/src/views/data_directory/data_risk_unit/index.vue @@ -0,0 +1,9 @@ + + + + + + + diff --git a/src/views/database/connect_enterprises_management/components/editDialog.vue b/src/views/database/connect_enterprises_management/components/editDialog.vue new file mode 100644 index 0000000..4527b6a --- /dev/null +++ b/src/views/database/connect_enterprises_management/components/editDialog.vue @@ -0,0 +1,452 @@ + + + + 企业基础信息 + + + + + + + + + + + 定位 + + + + 企业属性信息 + + + + + + 对接上级平台信息 + + 添加上级平台 + + + + + + + + + + + + + + + + + + + + + 添加编码 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 删除 + + + + + 提交 + 取消 + + + + + + + + diff --git a/src/views/database/connect_enterprises_management/index.vue b/src/views/database/connect_enterprises_management/index.vue new file mode 100644 index 0000000..b289827 --- /dev/null +++ b/src/views/database/connect_enterprises_management/index.vue @@ -0,0 +1,112 @@ + + + + + 新增平台 + + + + + + + + {{ row.thirdList.map((item) => item.platformName).join(",") }} + + + + + + {{ translationStatus(row.companyStatus, STATUS_LIST) }} + + + + + 查看 + + 编辑 + + + 删除 + + + + + + + + + + + diff --git a/src/views/database/serve_platform_management/components/editDialog.vue b/src/views/database/serve_platform_management/components/editDialog.vue new file mode 100644 index 0000000..2c6867d --- /dev/null +++ b/src/views/database/serve_platform_management/components/editDialog.vue @@ -0,0 +1,138 @@ + + + + + + 提交 + 取消 + + + + + + + diff --git a/src/views/database/serve_platform_management/index.vue b/src/views/database/serve_platform_management/index.vue new file mode 100644 index 0000000..6caedf8 --- /dev/null +++ b/src/views/database/serve_platform_management/index.vue @@ -0,0 +1,101 @@ + + + + + 新增平台 + + + + + + + + {{ row.thirdList.map((item) => item.platformName).join(",") }} + + + + + + {{ translationStatus(row.platformStatus, STATUS_LIST) }} + + + + + 查看 + + 编辑 + + + 删除 + + + + + + + + + + + diff --git a/src/views/database/superior_platform_management/components/dataItemsDialog.vue b/src/views/database/superior_platform_management/components/dataItemsDialog.vue new file mode 100644 index 0000000..75d442e --- /dev/null +++ b/src/views/database/superior_platform_management/components/dataItemsDialog.vue @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + 搜索 + + + + + + + + + + 是 + 否 + + + + + + + 是 + 否 + + + + + + + 提交 + 取消 + + + + + + + diff --git a/src/views/database/superior_platform_management/components/editDialog.vue b/src/views/database/superior_platform_management/components/editDialog.vue new file mode 100644 index 0000000..ecb9928 --- /dev/null +++ b/src/views/database/superior_platform_management/components/editDialog.vue @@ -0,0 +1,149 @@ + + + + + + + + + 提交 + 取消 + + + + + + + diff --git a/src/views/database/superior_platform_management/index.vue b/src/views/database/superior_platform_management/index.vue new file mode 100644 index 0000000..5f0cae9 --- /dev/null +++ b/src/views/database/superior_platform_management/index.vue @@ -0,0 +1,135 @@ + + + + + 新增平台 + + + + + {{ translationStatus(row.platformLevel, platformLevelOptions) }} + + + + + + + + {{ translationStatus(row.frequency, frequencyOptions) }} + + + + {{ translationStatus(row.platformStatus, STATUS_LIST) }} + + + + + + 对接项维护 + + 查看 + + 编辑 + + + 删除 + + + + + + + + + + + +