From 03f6b5dae57946da727caf5eca04b0516ec7142e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Mon, 6 Nov 2023 20:25:44 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E6=A0=87=E5=87=86=E5=8C=96=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/businessSupport.js | 14 +- src/common/lang/businessSupport/zh.js | 27 +- src/components/MindMap.vue | 29 +- src/components/customField/AddForm.vue | 1 - src/components/selection/UserSelectModal.vue | 1 + src/components/selection/UserSelection.vue | 11 +- src/enums/commonEnums.js | 8 + src/utils/validate.js | 14 +- .../StandardizationActivityPage.vue | 81 ++++- .../modules/ContactModal.vue | 182 ++++++++++ .../modules/GroupModal.vue | 231 ++++++++++++ .../modules/MeetingModal.vue | 127 +++++++ .../modules/PaymentModal.vue | 179 +++++++++ .../modules/StandardizationActivityDrawer.vue | 341 ++++++++++++++++++ .../tables/ContactTable.vue | 120 ++++++ .../tables/GroupTable.vue | 189 ++++++++++ .../tables/MeetingTable.vue | 159 ++++++++ .../tables/PaymentTable.vue | 177 +++++++++ 18 files changed, 1864 insertions(+), 27 deletions(-) create mode 100644 src/views/businessSupport/standardizationActivity/modules/ContactModal.vue create mode 100644 src/views/businessSupport/standardizationActivity/modules/GroupModal.vue create mode 100644 src/views/businessSupport/standardizationActivity/modules/MeetingModal.vue create mode 100644 src/views/businessSupport/standardizationActivity/modules/PaymentModal.vue create mode 100644 src/views/businessSupport/standardizationActivity/modules/StandardizationActivityDrawer.vue create mode 100644 src/views/businessSupport/standardizationActivity/tables/ContactTable.vue create mode 100644 src/views/businessSupport/standardizationActivity/tables/GroupTable.vue create mode 100644 src/views/businessSupport/standardizationActivity/tables/MeetingTable.vue create mode 100644 src/views/businessSupport/standardizationActivity/tables/PaymentTable.vue diff --git a/src/api/businessSupport.js b/src/api/businessSupport.js index 7890103c..1cdfed40 100644 --- a/src/api/businessSupport.js +++ b/src/api/businessSupport.js @@ -11,6 +11,14 @@ const deleteAnswer = (params) => postAction('/laws/library/lawsProblemLibrary/de // 标准化活动-树形图 const queryTreeList = (params) => getAction('/laws/standardization/lawsStandardization/queryTreeList', params) +// 标准化活动-新增 +const addNode = (params) => postAction('/laws/standardization/lawsStandardization/add', params) +// 标准化活动-编辑 +const editNode = (params) => postAction('/laws/standardization/lawsStandardization/edit', params) +// 标准化活动-通过id查询 +const queryById = (params) => getAction('/laws/standardization/lawsStandardization/queryById', params) +// 标准化活动-通过id查询表格信息 +const queryTableDataById = (params) => getAction('/laws/standardization/lawsStandardization/queryDetailById', params) export { getQuizById, @@ -19,5 +27,9 @@ export { deleteAnswer, // 标准化活动 - queryTreeList + queryTreeList, + addNode, + editNode, + queryById, + queryTableDataById } diff --git a/src/common/lang/businessSupport/zh.js b/src/common/lang/businessSupport/zh.js index ea6d8a24..aa2a5b2e 100644 --- a/src/common/lang/businessSupport/zh.js +++ b/src/common/lang/businessSupport/zh.js @@ -2,7 +2,32 @@ module.exports = { // 标准化活动 standardizationActivity: { nodeName: '节点名称', // 节点名称 - currentNode: '当前节点' + currentNode: '当前节点', + conferenceStatisticsList: '会议统计列表', + pleaseSelectNode: '请选择一个节点', + parentNode: '上级节点', + nodeTypes: '节点类型', + standardizationWorkArea: '标准化工作领域', + contactPersonContactInformation: '联络人联系方式', + unit: '单位', + phone: '电话', + groupParticipation: '集团参与情况', + paymentInfo: '支付信息', + attendanceRecord: '参会记录', + addContactInformation: '添加联系方式', + addParticipation: '添加参与情况', + addPaymentInfo: '添加支付信息', + addAttendanceRecord: '添加参会记录', + order: '我司在工作组排名顺序', + ourPersonnel: '我司人员', + data: '资料', + cost: '费用', + year: '年份', + plan: '计划内', + paymentMethod: '缴费方式', + expenseReimbursement: '费用列支', + meetingMaterial: '会议资料', + pleaseEnterCorrectPhone: '请输入正确格式的电话' }, // 问答库 questionAnswer: { diff --git a/src/components/MindMap.vue b/src/components/MindMap.vue index a3d26365..5ecd6d3f 100644 --- a/src/components/MindMap.vue +++ b/src/components/MindMap.vue @@ -72,7 +72,7 @@ export default { nodeWidth: { type: Number, required: false, - default: 300 + default: 400 }, // 节点高度 nodeHeight: { @@ -99,7 +99,6 @@ export default { watch: { mapData: { handler () { - console.log(this.mapData) this.data = JSON.parse(JSON.stringify(this.mapData)) if (this.loadEnd && this.data.id) { this.initMindMap() @@ -126,7 +125,6 @@ export default { } G6.registerNode('tree-node', { drawShape: (cfg, group) => { - console.log('自定义节点了',cfg) const nodeColorIndex = cfg.depth % NODE_COLOR.length const nodeStyle = NODE_COLOR[nodeColorIndex] // 节点整体的内容 @@ -155,12 +153,12 @@ export default { }) // 文本的部分 - let textContent = cfg.name || '' - if (textContent.length > 40) { - textContent = textContent.slice(0, 20) + '\n' + textContent.slice(20, 40) + '\n' + textContent.slice(40) - } else if (textContent.length > 20) { - textContent = textContent.slice(0, 20) + '\n' + textContent.slice(20) - } + let textContent = (cfg.num || '') + ' ' + (cfg.name || '') + // if (textContent.length > 40) { + // textContent = textContent.slice(0, 20) + '\n' + textContent.slice(20, 40) + '\n' + textContent.slice(40) + // } else if (textContent.length > 20) { + // textContent = textContent.slice(0, 20) + '\n' + textContent.slice(20) + // } group.addShape('text', { attrs: { text: textContent, @@ -199,7 +197,6 @@ export default { return nodeContainer }, setState (name, value, item) { - console.log(name, value) const group = item.getContainer() const nodeDom = group.get('children') const nodeBox = nodeDom[1] @@ -255,9 +252,9 @@ export default { } } }) - G6.Util.traverseTree(this.data, (item) => { - item.id = item[this.mapDataKeyField] - }) + // G6.Util.traverseTree(this.data, (item) => { + // item.id = item[this.mapDataKeyField] + // }) this.graph.data(this.data) this.graph.render() this.graph.fitView() @@ -288,6 +285,12 @@ export default { this.selectedNodeId = item._cfg.id this.graph.refreshItem(item._cfg.id) this.graph.layout() + // 选中抛出节点信息,取消选中抛出一个空对象 + if (item.getModel().selected) { + this.$emit('select', item._cfg.model) + } else { + this.$emit('select', {}) + } }, /** * 查询,定位高亮 diff --git a/src/components/customField/AddForm.vue b/src/components/customField/AddForm.vue index 8d421299..52874234 100644 --- a/src/components/customField/AddForm.vue +++ b/src/components/customField/AddForm.vue @@ -475,7 +475,6 @@ export default { rules[res.dbFieldName] = rule } }) - console.log(rules) this.rules = rules this.isFormInline = true this.confirmLoading = false diff --git a/src/components/selection/UserSelectModal.vue b/src/components/selection/UserSelectModal.vue index 8106f453..1765bf51 100644 --- a/src/components/selection/UserSelectModal.vue +++ b/src/components/selection/UserSelectModal.vue @@ -310,6 +310,7 @@ export default { } this.$emit('nameChange', this.dataSourceRight.map(item => item.realname + '(' + item.username + ')').join(',')) this.$emit('change', this.selectedRowKeys.join(',')) + this.$emit('listChange', this.dataSourceRight) this.close() }, handleCancel () { diff --git a/src/components/selection/UserSelection.vue b/src/components/selection/UserSelection.vue index f4a3a10f..5fef79c0 100644 --- a/src/components/selection/UserSelection.vue +++ b/src/components/selection/UserSelection.vue @@ -17,7 +17,12 @@ {{ $t('userSelect.select') }} - + @@ -82,6 +87,9 @@ export default { nameChange (value) { this.checkedValue = value this.$emit('nameChange', value, this.filedName) + }, + listChange (list) { + this.$emit('listChange', list) } }, model: { @@ -103,6 +111,7 @@ export default { resize: none; width: calc(100% - 70px); } + // 因为需要加title,所以不能把鼠标事件去掉 /deep/ .ant-input-disabled { background: #fff; diff --git a/src/enums/commonEnums.js b/src/enums/commonEnums.js index 541c663b..7877a95a 100644 --- a/src/enums/commonEnums.js +++ b/src/enums/commonEnums.js @@ -164,3 +164,11 @@ export const StandardProperty = { admittance: { text: '准入性', value: 'SN001' }, recommendation: { text: '推荐性', value: 'SN002' } } + +// 标准化活动类型 +export const StandardizedActivityType = new EsEnums({ + rootNode: { text: '根节点', value: '1' }, + secondLevelBidCommittee: { text: '分标委', value: '2' }, + workingTeam: { text: '工作组', value: '3' }, + fourLevelBiddingCommittee: { text: '分标委', value: '4' } +}) diff --git a/src/utils/validate.js b/src/utils/validate.js index c8edcac4..8e4cf24a 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -1,9 +1,10 @@ /** * 邮箱 * @param {*} s + * 之前的正则 /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ */ -export function isEmail (s) { - return /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s) +export function isEmail(s) { + return /^\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/.test(s) } /** @@ -29,3 +30,12 @@ export function isPhone (s) { export function isURL (s) { return /^http[s]?:\/\/.*/.test(s) } + +/** + * 手机号或座机号 + * + * /^((13[0-9])|(14[579])|(15([0-3]|[5-9]))|(17[0135678])|(18[0-9])|(19[8|9])|(16[6]))\d{8}$/ + * */ +export function phoneReg(s) { + return /(^[1][3,4,5,6,7,8,9][0-9]{9}$)|(^0\d{2,3}-?\d{7,8}$)/.test(s) +} \ No newline at end of file diff --git a/src/views/businessSupport/standardizationActivity/StandardizationActivityPage.vue b/src/views/businessSupport/standardizationActivity/StandardizationActivityPage.vue index f7398a24..a471eabf 100644 --- a/src/views/businessSupport/standardizationActivity/StandardizationActivityPage.vue +++ b/src/views/businessSupport/standardizationActivity/StandardizationActivityPage.vue @@ -8,13 +8,29 @@ + + - + + + + @@ -52,10 +71,11 @@ import MindMap from '../../../components/MindMap.vue' import InternalDetailPage from '../../../components/InternalDetailPage' import { queryTreeList } from '../../../api/businessSupport' +import StandardizationActivityDrawer from './modules/StandardizationActivityDrawer' export default { name: 'StandardizationActivityPage', - components: { InternalDetailPage, MindMap }, + components: { InternalDetailPage, MindMap, StandardizationActivityDrawer }, data () { return { nodeName: '', @@ -64,7 +84,9 @@ export default { data: {}, currentNodeName: '', showSearch: false, - loading: false + loading: false, + selectedNodeId: null, // 选中节点的信息 + selectedNode: {} } }, created () { @@ -91,9 +113,6 @@ export default { return } this.nodeNameList = this.defaultNodeNameList.filter(tt => tt.name.toLowerCase().indexOf(this.nodeName.toLowerCase()) !== -1) - }, - handleChange () { - }, searchReset () { @@ -106,7 +125,7 @@ export default { }, treeToArr (data, pid = null, res) { data.forEach(item => { - res.push({ name: item.name, id: item.name }) + res.push(item) if (item.children && item.children.length !== 0) { this.treeToArr(item.children, item.id, res) } @@ -158,6 +177,42 @@ export default { }, handleSearchNode (node) { this.$refs.mindMap.searchNode(node.id) + }, + /** + * 选中/取消选中节点 + * @param node + */ + handleSelectNode (node) { + this.selectedNodeId = node.id + this.selectedNode = Object.assign({}, node || {}) + }, + modalFormOk () { + this.loadData() + }, + handleAdd () { + // 需要先选中一个节点 + if (!this.selectedNodeId) { + this.$message.warning(this.$t('businessSupport.standardizationActivity.pleaseSelectNode')) + return + } + this.$refs.modalForm.add({ pid: this.selectedNodeId, pName: this.selectedNode.name, level: this.selectedNode.level + 1 }) + }, + handleEdit () { + // 需要先选中一个节点 + if (!this.selectedNodeId) { + this.$message.warning(this.$t('businessSupport.standardizationActivity.pleaseSelectNode')) + return + } + this.$refs.modalForm.edit(this.selectedNodeId) + }, + handleDetail () { + console.log(this.selectedNodeId) + // 需要先选中一个节点 + if (!this.selectedNodeId) { + this.$message.warning(this.$t('businessSupport.standardizationActivity.pleaseSelectNode')) + return + } + this.$refs.modalForm.view(this.selectedNodeId) } } } @@ -255,4 +310,14 @@ export default { right: 0; bottom: 0; } + +.custom-operate { + .ant-btn { + margin-left: 12px; + } + + .ant-btn:first-child { + margin-left: 0; + } +} diff --git a/src/views/businessSupport/standardizationActivity/modules/ContactModal.vue b/src/views/businessSupport/standardizationActivity/modules/ContactModal.vue new file mode 100644 index 00000000..2ca207dd --- /dev/null +++ b/src/views/businessSupport/standardizationActivity/modules/ContactModal.vue @@ -0,0 +1,182 @@ + + + + + \ No newline at end of file diff --git a/src/views/businessSupport/standardizationActivity/modules/GroupModal.vue b/src/views/businessSupport/standardizationActivity/modules/GroupModal.vue new file mode 100644 index 00000000..1c9b2aa5 --- /dev/null +++ b/src/views/businessSupport/standardizationActivity/modules/GroupModal.vue @@ -0,0 +1,231 @@ + + + + + \ No newline at end of file diff --git a/src/views/businessSupport/standardizationActivity/modules/MeetingModal.vue b/src/views/businessSupport/standardizationActivity/modules/MeetingModal.vue new file mode 100644 index 00000000..a442b631 --- /dev/null +++ b/src/views/businessSupport/standardizationActivity/modules/MeetingModal.vue @@ -0,0 +1,127 @@ + + + + + \ No newline at end of file diff --git a/src/views/businessSupport/standardizationActivity/modules/PaymentModal.vue b/src/views/businessSupport/standardizationActivity/modules/PaymentModal.vue new file mode 100644 index 00000000..9043a5f3 --- /dev/null +++ b/src/views/businessSupport/standardizationActivity/modules/PaymentModal.vue @@ -0,0 +1,179 @@ + + + + + \ No newline at end of file diff --git a/src/views/businessSupport/standardizationActivity/modules/StandardizationActivityDrawer.vue b/src/views/businessSupport/standardizationActivity/modules/StandardizationActivityDrawer.vue new file mode 100644 index 00000000..9a469270 --- /dev/null +++ b/src/views/businessSupport/standardizationActivity/modules/StandardizationActivityDrawer.vue @@ -0,0 +1,341 @@ + + + + + \ No newline at end of file diff --git a/src/views/businessSupport/standardizationActivity/tables/ContactTable.vue b/src/views/businessSupport/standardizationActivity/tables/ContactTable.vue new file mode 100644 index 00000000..e60c7355 --- /dev/null +++ b/src/views/businessSupport/standardizationActivity/tables/ContactTable.vue @@ -0,0 +1,120 @@ + + + + + \ No newline at end of file diff --git a/src/views/businessSupport/standardizationActivity/tables/GroupTable.vue b/src/views/businessSupport/standardizationActivity/tables/GroupTable.vue new file mode 100644 index 00000000..0c58f6f6 --- /dev/null +++ b/src/views/businessSupport/standardizationActivity/tables/GroupTable.vue @@ -0,0 +1,189 @@ + + + + + \ No newline at end of file diff --git a/src/views/businessSupport/standardizationActivity/tables/MeetingTable.vue b/src/views/businessSupport/standardizationActivity/tables/MeetingTable.vue new file mode 100644 index 00000000..4a910326 --- /dev/null +++ b/src/views/businessSupport/standardizationActivity/tables/MeetingTable.vue @@ -0,0 +1,159 @@ + + + + + \ No newline at end of file diff --git a/src/views/businessSupport/standardizationActivity/tables/PaymentTable.vue b/src/views/businessSupport/standardizationActivity/tables/PaymentTable.vue new file mode 100644 index 00000000..4a135fb7 --- /dev/null +++ b/src/views/businessSupport/standardizationActivity/tables/PaymentTable.vue @@ -0,0 +1,177 @@ + + + + + \ No newline at end of file