From 6508e19c8d2e266c7405439ac32c06df6f602439 Mon Sep 17 00:00:00 2001
From: feige <feige@qq.com>
Date: 星期二, 06 一月 2026 16:14:50 +0800
Subject: [PATCH] 修改代码
---
ruoyi-ui/src/views/bignote/index.vue | 161 ++++++++++++++++++++++----
ruoyi-ui/vue.config.js | 4
ruoyi-ui/src/views/bignote/familyeventInfo.vue | 180 +++++++++++++++++++++++++++---
3 files changed, 300 insertions(+), 45 deletions(-)
diff --git a/ruoyi-ui/src/views/bignote/familyeventInfo.vue b/ruoyi-ui/src/views/bignote/familyeventInfo.vue
index 09a767a..d548fb8 100644
--- a/ruoyi-ui/src/views/bignote/familyeventInfo.vue
+++ b/ruoyi-ui/src/views/bignote/familyeventInfo.vue
@@ -47,6 +47,31 @@
</div>
</el-form-item>
+ <!-- 鍏跺畠浜烘樉绀哄尯鍩� -->
+ <el-form-item label="鍏跺畠浜�">
+ <!-- 宸查�夊叾瀹冧汉鏍囩鏄剧ず -->
+ <div v-if="otherPeople.length > 0" class="selected-members" style="display: inline-block; vertical-align: middle; margin-right: 10px;">
+ <el-tag
+ v-for="(name, index) in otherPeople"
+ :key="index"
+ closable
+ @close="handleOtherPeopleTagClose(index)"
+ >
+ {{ name }}
+ </el-tag>
+ </div>
+ <!-- 缂栬緫鎸夐挳 -->
+ <el-button
+ v-if="!dsb"
+ type="primary"
+ icon="el-icon-edit"
+ size="mini"
+ @click="openOtherPeopleDialog"
+ >
+ 缂栬緫鍏跺畠浜�
+ </el-button>
+ </el-form-item>
+
<el-form-item label="鍦扮偣" prop="address">
<el-input v-model="formData.address" placeholder="璇疯緭鍏ュ湴鐐�" clearable :style="{width: '100%'}" :disabled="dsb">
@@ -292,6 +317,50 @@
</div>
</el-dialog>
+ <!-- 鍏跺畠浜虹紪杈戝脊绐� -->
+ <el-dialog
+ :visible.sync="otherPeopleDialogVisible"
+ title="缂栬緫鍏跺畠浜�"
+ width="500px"
+ :close-on-click-modal="false"
+ @close="handleOtherPeopleDialogClose"
+ >
+ <!-- 宸叉坊鍔犵殑鍏跺畠浜烘爣绛� -->
+ <div v-if="tempOtherPeople.length > 0" class="selected-members" style="margin-bottom: 20px;">
+ <el-tag
+ v-for="(name, index) in tempOtherPeople"
+ :key="index"
+ closable
+ @close="handleTempOtherPeopleTagClose(index)"
+ >
+ {{ name }}
+ </el-tag>
+ </div>
+
+ <!-- 娣诲姞杈撳叆妗� -->
+ <div style="display: flex; align-items: center;">
+ <el-input
+ v-model="otherPeopleInput"
+ placeholder="璇疯緭鍏ュ鍚嶏紝鎸夊洖杞︽垨鐐瑰嚮娣诲姞"
+ clearable
+ style="flex: 1; margin-right: 10px;"
+ @keyup.enter.native="addOtherPeople"
+ ></el-input>
+ <el-button
+ type="primary"
+ icon="el-icon-plus"
+ @click="addOtherPeople"
+ >
+ 娣诲姞
+ </el-button>
+ </div>
+
+ <!-- 寮圭獥搴曢儴鎸夐挳 -->
+ <div slot="footer" class="dialog-footer">
+ <el-button @click="otherPeopleDialogVisible = false">鍙栨秷</el-button>
+ <el-button type="primary" @click="confirmOtherPeople">瀹屾垚</el-button>
+ </div>
+ </el-dialog>
</div>
</template>
@@ -316,6 +385,10 @@
anotherFamilyMembers: [], //鍙﹀瀹舵棌鎴愬憳淇℃伅
selectedMemberIds: [], // 寮圭獥涓复鏃堕�変腑鐨勬垚鍛業D锛堢敤浜庡閫変氦浜掞級
displayMemberNames: [], // 鏄剧ず鐢ㄧ殑鎴愬憳鍚嶇О鏁扮粍
+ otherPeople: [], // 鍏跺畠浜哄垪琛�
+ tempOtherPeople: [], // 寮圭獥涓复鏃剁紪杈戠殑鍏跺畠浜哄垪琛�
+ otherPeopleInput: '', // 鍏跺畠浜鸿緭鍏ユ鍐呭
+ otherPeopleDialogVisible: false, // 鍏跺畠浜哄脊绐楀彲瑙佹��
memberSearch: '', // 鎴愬憳鎼滅储鍏抽敭璇�
loading: false, // 鍔犺浇鐘舵��
cdi:"瀹跺涵澶т簨璁颁俊鎭�",
@@ -512,6 +585,60 @@
console.log(this.selectedMemberNames)
},
+ // 绉婚櫎鍏跺畠浜烘爣绛�
+ handleOtherPeopleTagClose(index) {
+ const removedName = this.otherPeople[index];
+ this.otherPeople.splice(index, 1);
+ this.$message.info(`宸茬Щ闄�: ${removedName}`);
+ },
+
+ // 鎵撳紑鍏跺畠浜虹紪杈戝脊绐�
+ openOtherPeopleDialog() {
+ // 澶嶅埗褰撳墠鍏跺畠浜哄垪琛ㄥ埌涓存椂鍒楄〃
+ this.tempOtherPeople = [...this.otherPeople];
+ this.otherPeopleInput = '';
+ this.otherPeopleDialogVisible = true;
+ },
+
+ // 寮圭獥鍐呮坊鍔犲叾瀹冧汉
+ addOtherPeople() {
+ const name = this.otherPeopleInput.trim();
+ if (!name) {
+ this.$message.warning('璇疯緭鍏ュ鍚�');
+ return;
+ }
+ if (this.tempOtherPeople.includes(name)) {
+ this.$message.warning('璇ュ鍚嶅凡娣诲姞');
+ return;
+ }
+ this.tempOtherPeople.push(name);
+ this.otherPeopleInput = '';
+ this.$message.success(`宸叉坊鍔�: ${name}`);
+ },
+
+ // 寮圭獥鍐呯Щ闄ゅ叾瀹冧汉鏍囩
+ handleTempOtherPeopleTagClose(index) {
+ const removedName = this.tempOtherPeople[index];
+ this.tempOtherPeople.splice(index, 1);
+ this.$message.info(`宸茬Щ闄�: ${removedName}`);
+ },
+
+ // 纭瀹屾垚锛堜繚瀛樺脊绐椾腑鐨勬洿鏀癸級
+ confirmOtherPeople() {
+ if (this.tempOtherPeople.length > 0) {
+ this.$message.success(`宸蹭繚瀛� ${this.tempOtherPeople.length} 鍚嶅叾瀹冧汉`);
+ } else {
+ this.$message.info('鏈坊鍔犱换浣曞叾瀹冧汉');
+ }
+ this.otherPeople = [...this.tempOtherPeople];
+ this.otherPeopleDialogVisible = false;
+ },
+
+ // 鍏跺畠浜哄脊绐楀叧闂鐞�
+ handleOtherPeopleDialogClose() {
+ this.otherPeopleInput = '';
+ // 涓嶄繚瀛樹复鏃跺垪琛ㄧ殑鏇存敼
+ },
// 纭閫夋嫨鎴愬憳锛堜繚瀛樺埌琛ㄥ崟锛�
confirmMemberSelection() {
console.log(this.selectedMemberIds)
@@ -530,16 +657,29 @@
// 1. 鍒ゆ柇 people 鏄惁瀛樺湪涓斾负瀛楃涓诧紝閬垮厤鎶ラ敊
if (!people || typeof people !== "string") {
this.displayMemberNames = [];
+ this.otherPeople = [];
return;
}
- console.log(people.split(","))
- // 2. 鎸夐�楀彿鍒嗗壊瀛楃涓诧紝鍘婚櫎姣忎釜鍏冪礌鐨勫墠鍚庣┖鏍硷紝杩囨护绌哄�硷紙濡傝繛缁�楀彿鐨勬儏鍐碉級
- this.displayMemberNames = people.split(",")
- // people
- //.split(",") // 鎸夐�楀彿鍒嗗壊涓烘暟缁�
- //.map((name) => name.trim()) // 鍘婚櫎姣忎釜鍏冪礌鐨勫墠鍚庣┖鏍�
- // .filter((name) => name); // 杩囨护绌哄瓧绗︿覆锛堝鐞� "a,,b" 杩欑被鎯呭喌锛�
- console.log(this.displayMemberNames)
+
+ // 2. 鍏堟寜鍒嗗彿鍒嗗壊锛氱涓�閮ㄥ垎鏄鏃忔垚鍛橈紝绗簩閮ㄥ垎鏄叾瀹冧汉
+ const parts = people.split(';');
+
+ // 绗竴閮ㄥ垎锛氭寜閫楀彿鍒嗗壊璧嬪�肩粰 displayMemberNames
+ if (parts[0]) {
+ this.displayMemberNames = parts[0].split(",").map(name => name.trim()).filter(name => name);
+ } else {
+ this.displayMemberNames = [];
+ }
+
+ // 绗簩閮ㄥ垎锛氭寜閫楀彿鍒嗗壊璧嬪�肩粰 otherPeople
+ if (parts[1]) {
+ this.otherPeople = parts[1].split(",").map(name => name.trim()).filter(name => name);
+ } else {
+ this.otherPeople = [];
+ }
+
+ console.log('瀹舵棌鎴愬憳:', this.displayMemberNames)
+ console.log('鍏跺畠浜�:', this.otherPeople)
},
// 鎵撳紑鎴愬憳澶氶�夊脊绐�
async openMemberDialog() {
@@ -617,16 +757,11 @@
},
submitForm() {
- // let ul = this.fileList.map(function (elem){
- // return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
- // }).join(",")
- // let uls = this.fileListOther.map(function (elem){
- // return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
- // }).join(",")
- // this.formData.url = ul+","+uls
- var pel = ""
- pel = pel + this.selectedMemberNames.join(",")
- this.formData.people = pel;
+ // 缁勫悎鏁版嵁锛氬鏃忔垚鍛樻寜閫楀彿鍒嗛殧锛屽叾瀹冧汉鎸夐�楀彿鍒嗛殧锛屼袱閮ㄥ垎鐢ㄥ垎鍙峰垎闅�
+ const memberPart = this.selectedMemberNames.join(",");
+ const otherPart = this.otherPeople.join(",");
+ this.formData.people = `${memberPart};${otherPart}`;
+
this.$refs['elForm'].validate(valid => {
if (valid) {
if (this.formData.id != undefined) {
@@ -924,3 +1059,12 @@
background:center/11% no-repeat url('../../assets/icons/form.png') ;
}
</style>
+
+
+
+
+
+
+
+
+
diff --git a/ruoyi-ui/src/views/bignote/index.vue b/ruoyi-ui/src/views/bignote/index.vue
index e6849d4..966c01e 100644
--- a/ruoyi-ui/src/views/bignote/index.vue
+++ b/ruoyi-ui/src/views/bignote/index.vue
@@ -276,6 +276,30 @@
閫夋嫨瀹舵棌鎴愬憳
</el-button>
</el-form-item>
+
+ <!-- 鍏跺畠浜洪�夋嫨瀛楁 -->
+ <el-form-item label="鍏跺畠浜�" prop="otherPeople">
+ <!-- 宸查�夊叾瀹冧汉鍥炴樉鍖哄煙 -->
+ <div v-if="formDat.otherPeople && formDat.otherPeople.length > 0" class="selected-members">
+ <el-tag
+ v-for="(name, index) in formDat.otherPeople"
+ :key="index"
+ closable
+ @close="handleOtherPeopleTagClose(index)"
+ >
+ {{ name }}
+ </el-tag>
+ </div>
+ <!-- 瑙﹀彂寮圭獥鎸夐挳 -->
+ <el-button
+ type="primary"
+ icon="el-icon-user"
+ @click="openOtherPeopleDialog"
+ :disabled="loading"
+ >
+ 娣诲姞鍏跺畠浜�
+ </el-button>
+ </el-form-item>
<el-form-item label="鍦扮偣" prop="address">
<el-input v-model="formDat.address" placeholder="璇疯緭鍏ュ湴鐐�" clearable :style="{width: '100%'}" >
</el-input>
@@ -481,6 +505,49 @@
<el-button type="primary" @click="confirmMemberSelection">纭閫夋嫨</el-button>
</div>
</el-dialog>
+
+ <!-- 鍏跺畠浜哄脊绐� -->
+ <el-dialog
+ :visible.sync="otherPeopleDialogVisible"
+ title="娣诲姞鍏跺畠浜�"
+ width="400px"
+ :close-on-click-modal="false"
+ @close="handleOtherPeopleDialogClose"
+ >
+ <div class="other-people-dialog">
+ <el-input
+ v-model="otherPeopleInput"
+ placeholder="璇疯緭鍏ュ鍚嶏紝鎸夊洖杞︽垨鐐瑰嚮娣诲姞鎸夐挳娣诲姞"
+ @keyup.enter.native="addOtherPeople"
+ style="margin-bottom: 20px;"
+ >
+ <el-button slot="append" icon="el-icon-plus" @click="addOtherPeople">娣诲姞</el-button>
+ </el-input>
+
+ <!-- 宸叉坊鍔犵殑鍏跺畠浜哄垪琛� -->
+ <div v-if="formDat.otherPeople && formDat.otherPeople.length > 0" class="added-people-list">
+ <el-divider content-position="left">宸叉坊鍔� ({{ formDat.otherPeople.length }}浜�)</el-divider>
+ <el-tag
+ v-for="(name, index) in formDat.otherPeople"
+ :key="index"
+ closable
+ @close="handleOtherPeopleTagClose(index)"
+ style="margin-right: 8px; margin-bottom: 8px;"
+ >
+ {{ name }}
+ </el-tag>
+ </div>
+
+ <div v-else class="no-people" style="padding: 20px 0;">
+ <el-empty description="鏆傛湭娣诲姞浠讳綍浜�" :image-size="60"></el-empty>
+ </div>
+ </div>
+
+ <div slot="footer" class="dialog-footer">
+ <el-button type="primary" @click="confirmOtherPeople">瀹屾垚</el-button>
+ </div>
+ </el-dialog>
+
<!-- 鍒嗕韩瀵硅瘽妗�1 -->
<el-dialog :title="title1" :visible.sync="open1" width="500px" append-to-body @close="handleClose2">
@@ -711,9 +778,13 @@
dsb:true,
btn:false,
uploading: false,
+ // 鍏跺畠浜哄脊绐楃浉鍏�
+ otherPeopleDialogVisible: false,
+ otherPeopleInput: '',
formDat: {
// type: undefined,
selectedMemberIds: [],
+ otherPeople: [], // 瀛樺偍鍏跺畠浜哄悕瀛�
title: undefined,
location: undefined,
holder: undefined,
@@ -798,7 +869,7 @@
return this.displayMemberNames;
}
-
+
// 鍚﹀垯鏍规嵁閫変腑鐨処D璁$畻
// 鍚堝苟杩囨护鍚庣殑鎴愬憳鍚嶇О鍜宒isplayMemberNames鍐呭
console.log(this.selectedMemberIds)
@@ -1109,6 +1180,50 @@
}
);
},
+openOtherPeopleDialog(){
+ this.otherPeopleDialogVisible = true;
+ this.otherPeopleInput = ''; // 娓呯┖杈撳叆妗�
+ },
+
+ // 娣诲姞鍏跺畠浜猴紙鏀寔鍥炶溅鍜岀偣鍑绘坊鍔犳寜閽級
+ addOtherPeople() {
+ const name = this.otherPeopleInput.trim();
+ if (!name) {
+ this.$message.warning('璇疯緭鍏ュ鍚�');
+ return;
+ }
+ if (this.formDat.otherPeople.includes(name)) {
+ this.$message.warning('璇ュ鍚嶅凡娣诲姞');
+ return;
+ }
+ this.formDat.otherPeople.push(name);
+ this.otherPeopleInput = ''; // 娓呯┖杈撳叆妗嗭紝鍑嗗杈撳叆涓嬩竴涓�
+ this.$message.success(`宸叉坊鍔�: ${name}`);
+ },
+
+ // 纭瀹屾垚锛堝叧闂脊绐楋級
+ confirmOtherPeople() {
+ if (this.formDat.otherPeople.length > 0) {
+ this.$message.success(`宸叉坊鍔� ${this.formDat.otherPeople.length} 鍚嶅叾瀹冧汉`);
+ } else {
+ this.$message.info('鏈坊鍔犱换浣曞叾瀹冧汉');
+ }
+ this.otherPeopleDialogVisible = false;
+ },
+
+ // 鍏抽棴鍏跺畠浜烘爣绛�
+ handleOtherPeopleTagClose(index) {
+ const removedName = this.formDat.otherPeople[index];
+ this.formDat.otherPeople.splice(index, 1);
+ this.$message.info(`宸茬Щ闄�: ${removedName}`);
+ },
+
+ // 鍏跺畠浜哄脊绐楀叧闂鐞�
+ handleOtherPeopleDialogClose() {
+ this.otherPeopleInput = '';
+ },
+
+ // ------------------- 鎭㈠琚垹闄ょ殑鏂规硶 -------------------
// 鍙栨秷鎸夐挳
cancel() {
@@ -1157,7 +1272,6 @@
// 澶氶�夋閫変腑鏁版嵁
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
- // alert(this.ids)
this.single = selection.length!=1
this.multiple = !selection.length
},
@@ -1169,11 +1283,10 @@
this.title = "娣诲姞瀹跺涵澶т簨璁颁俊鎭�";
},
-
/** 鏌ョ湅璇︾粏淇℃伅 */
handleCheck(row){
const id = row.id;
- this.open2 = false;
+ this.open2 = false;
this.$router.push("/familymodel/bignote/familyeventInfo/" + id);
},
/** 淇敼鎸夐挳鎿嶄綔 */
@@ -1190,33 +1303,23 @@
},
handleRemove(file) {
- //alert(98)
- //alert(this.fileList.length)
- for(let i = 0; i < this.fileList.length; i++)
- {
- if(this.fileList[i].url==file.url)
- {
- this.$delete(this.fileList,i);
- this.$delete(this.uploadFileList,i);
- }
- }
- // let ul = this.fileList.map(function (elem){
- // return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
- // }).join(",")
- // alert(this.fileListOther.length)
- // let uls = this.fileListOther.map(function (elem){
- // return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
- // }).join(",")
- // this.formDat.url = ul+","+uls;
+ for(let i = 0; i < this.fileList.length; i++)
+ {
+ if(this.fileList[i].url==file.url)
+ {
+ this.$delete(this.fileList,i);
+ this.$delete(this.uploadFileList,i);
+ }
+ }
},
handleRemoveFile(file) {
for(let i = 0; i < this.fileListOther.length; i++)
{
if(this.fileListOther[i].url==file.url)
- {
+ {
this.$delete(this.fileListOther,i);
- this.$delete(this.uploadFileList1,i);
- }
+ this.$delete(this.uploadFileList1,i);
+ }
}
},
@@ -1224,6 +1327,8 @@
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
+
+ //
handleTagClose(index, name) {
// 浠� selectedMemberNames 鏁扮粍涓Щ闄ゅ綋鍓嶅叧闂殑鏍囩鍚嶇О
// const index = this.selectedMemberNames.findIndex(item=== name);
@@ -1255,6 +1360,11 @@
//鎶婂悕瀛楄繛鍦ㄤ竴璧�
var pel = ""
pel = pel + this.selectedMemberNames.join(",")
+ if(this.formDat.otherPeople.length != 0)
+ {
+ pel = pel +";"+ this.formDat.otherPeople.join(",")
+ }
+ // alert(pel)
this.formDat.people = pel;
this.$refs["elForm"].validate(valid => {
if (valid) {
@@ -1480,6 +1590,7 @@
selectedMemberNames: this.selectedMemberNames.filter(
item => item !== name // 杩囨护鎺変笌鍏抽棴鍚嶇О鐩稿悓鐨勫厓绱�
)
+ this.displayMemberNames = this.selectedMemberNames
console.log(this.selectedMemberNames)
},
diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js
index 8e7639d..e8589b0 100644
--- a/ruoyi-ui/vue.config.js
+++ b/ruoyi-ui/vue.config.js
@@ -37,8 +37,8 @@
// detail: https://cli.vuewww.bendudu.comjs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
// target: `https://10.39.2.234:8080/`,
- target: `https://10.39.18.174:8080/`,
- //target: 'https://www.bendudu.com:8080/',
+ //target: `https://10.39.18.174:8080/`,
+ target: 'https://www.bendudu.com:8080/',
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
--
Gitblit v1.9.1