From 20091da23b5accc765b8a018296e19d60ca514de Mon Sep 17 00:00:00 2001
From: liwenxuan <1298531568@qq.com>
Date: Fri, 12 Dec 2025 14:32:58 +0800
Subject: [PATCH] =?UTF-8?q?=E9=80=89=E9=A1=B9=E6=89=B9=E9=87=8F=E5=AF=BC?=
=?UTF-8?q?=E5=85=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DesignForm/formControlPropertiNew.vue | 208 ++++++++++++++++++
1 file changed, 208 insertions(+)
diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue
index 7a8cc8f..2b81063 100644
--- a/src/components/DesignForm/formControlPropertiNew.vue
+++ b/src/components/DesignForm/formControlPropertiNew.vue
@@ -2829,6 +2829,67 @@ function getAssociatedFormsCurrentFieldTree1() {
});
}
+
+//选项批量编辑 liwenxuan 20251212 start
+
+// 初始选项数据
+const options = ref([])
+
+// 选中的值
+const selectedValues = ref(["1", "3"])
+
+// 弹窗显示状态
+const dialogVisible = ref(false)
+
+// 编辑时的文本内容(每行一个选项)
+const editText = ref('')
+
+// 打开弹窗
+const openDialog = () => {
+ // 将选项数组转换为文本,每行一个
+ editText.value = options.value.map(option => option.label).join('\n')
+ dialogVisible.value = true
+}
+
+// 取消编辑
+const cancelEditing = () => {
+ dialogVisible.value = false
+ editText.value = ''
+}
+
+// 保存更改
+const saveChanges = () => {
+ // 按行分割文本,过滤空行和空白字符
+ const lines = editText.value
+ .split('\n')
+ .map(line => line.trim())
+ .filter(line => line !== '')
+
+ // 生成新的选项数组
+ const newOptions = lines.map((label, index) => ({
+ label,
+ value: (index + 1).toString() // 从1开始的正整数
+ }))
+
+ // 更新选项列表
+ options.value = newOptions
+
+ // 关闭弹窗
+ dialogVisible.value = false
+
+ // 清空编辑文本
+ editText.value = ''
+
+ console.log('选项已更新:', {
+ options: options.value,
+ selected: selectedValues.value
+ })
+}
+
+//选项批量编辑 liwenxuan 20251212 end
+
+
+
//关联选项设置优化为树 liwenxuan 20251209 start
let datapropsformList = JSON.parse(JSON.stringify(props.formList))
const glxxszTree = computed(()=>{
@@ -6151,6 +6212,12 @@ const formatTooltip = (val: number) => {
controlData.type === "cascader" ? "编辑" : "新增"
}}
+
+
+ 批量编辑
+
+
+
{
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -8101,4 +8206,107 @@ li::before {
.card-header {
text-align: right;
}
+
+
+.batch-edit-demo {
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
+ max-width: 600px;
+ margin: 20px auto;
+ padding: 20px;
+}
+
+.display-mode {
+ border: 1px solid #DCDFE6;
+ border-radius: 4px;
+ padding: 20px;
+ margin-bottom: 20px;
+}
+
+.display-mode h4 {
+ margin-top: 0;
+ margin-bottom: 15px;
+ color: #303133;
+}
+
+.edit-header {
+ margin-bottom: 20px;
+}
+
+.edit-title {
+ display: block;
+ font-weight: 500;
+ font-size: 14px;
+ color: #303133;
+ margin-bottom: 4px;
+}
+
+.edit-hint {
+ font-size: 12px;
+ color: #909399;
+}
+
+.textarea-container {
+ margin-bottom: 10px;
+}
+
+.action-bar {
+ margin-top: 20px;
+ display: flex;
+ justify-content: flex-end;
+}
+
+.el-checkbox {
+ display: block;
+ margin-bottom: 8px;
+}
+
+.el-checkbox:last-child {
+ margin-bottom: 0;
+}
+
+.dialog-content {
+ padding: 10px 0;
+}
+
+:deep(.el-dialog__header) {
+ margin-right: 0;
+ padding-bottom: 10px;
+ border-bottom: 1px solid #F0F0F0;
+}
+
+:deep(.el-dialog__title) {
+ font-size: 16px;
+ font-weight: 500;
+ color: #303133;
+}
+
+:deep(.el-dialog__footer) {
+ padding-top: 20px;
+ border-top: 1px solid #F0F0F0;
+}
+
+:deep(.el-textarea__inner) {
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
+ line-height: 1.5;
+ padding: 12px;
+}
+
+.status-info {
+ padding: 15px;
+ background-color: #f5f7fa;
+ border-radius: 4px;
+ border: 1px solid #e4e7ed;
+}
+
+.status-info h4 {
+ margin-top: 0;
+ margin-bottom: 10px;
+ color: #303133;
+}
+
+.status-info p {
+ margin: 5px 0;
+ font-size: 14px;
+ color: #606266;
+}