|
|
|
@ -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" ? "编辑" : "新增" |
|
|
|
}}</el-button> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item class="form_cont"> |
|
|
|
<el-button type="primary" size="small" @click="openDialog" > |
|
|
|
批量编辑 |
|
|
|
</el-button> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</template> |
|
|
|
<template v-else-if="controlData.config.optionsType === 3"> |
|
|
|
<el-button |
|
|
|
@ -7902,6 +7969,44 @@ const formatTooltip = (val: number) => { |
|
|
|
<!-- 用户组织联动选择 end --> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 选项批量编辑 liwenxuan 20251212 start --> |
|
|
|
<!-- 编辑弹窗 --> |
|
|
|
<el-dialog |
|
|
|
v-model="dialogVisible" |
|
|
|
title="批量编辑" |
|
|
|
width="500px" |
|
|
|
:close-on-click-modal="false" |
|
|
|
:close-on-press-escape="false" |
|
|
|
> |
|
|
|
<div class="dialog-content"> |
|
|
|
<div class="edit-header"> |
|
|
|
<span class="edit-title">多选框-批量编辑</span> |
|
|
|
<span class="edit-hint">每行对应一个选项</span> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="textarea-container"> |
|
|
|
<el-input |
|
|
|
v-model="editText" |
|
|
|
type="textarea" |
|
|
|
:rows="8" |
|
|
|
placeholder="请输入选项,每行一个" |
|
|
|
resize="none" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<template #footer> |
|
|
|
<span class="dialog-footer"> |
|
|
|
<el-button @click="cancelEditing">取消</el-button> |
|
|
|
<el-button type="primary" @click="saveChanges">确定</el-button> |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 选项批量编辑 liwenxuan 20251212 end --> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 单选下拉多选选项来源value3--系统表单字段 start--> |
|
|
|
@ -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; |
|
|
|
} |
|
|
|
</style> |
|
|
|
|