hookehuyr

fix 更多属性里面判断按钮文字是否显示修改,按成员选择后,右边区域不应该刷新成初始展示的页面

......@@ -235,7 +235,7 @@
<div><el-switch v-model="state.more_attr_data.show" /></div>
</div>
<p class="more-attr-tip">{{ state.more_attr_data.desc }}</p>
<div v-if="state.more_attr_data.btnText">
<div v-if="state.more_attr_data.showBtn">
<p style="font-size: 14px; font-weight: bold;">按钮文字</p>
<el-input v-model="state.more_attr_data.btnText" />
</div>
......@@ -496,6 +496,7 @@ export default {
more_attr_data: {
label: '',
show: false,
showBtn: true,
desc: '',
btnText: '',
},
......@@ -828,6 +829,7 @@ export default {
state.select_attr_set = true;
}
state.statusLoading = true;
state.main_attr_set = true; // 重置更多属性的显示
//
axios.get('/admin/?a=flow_node_property&node_code=' + model.id + '&flow_id=' + flow_id)
.then((res: any) => {
......@@ -998,6 +1000,11 @@ export default {
const setMoreAttr = (attr: any, index: any) => { // 打开更多属性细节回调
state.main_attr_set = false;
state.more_attr_data = attr['data'][index]; // 同步数据
if (attr.id === 'no-1') { // 如果是审批意见,按钮文字不可以修改
state.more_attr_data.showBtn = false;
} else {
state.more_attr_data.showBtn = true;
}
}
const onConfirmMoreAttr = (item: any) => { // 保存更多属性细节回调
state.main_attr_set = true;
......
<!--
* @Date: 2023-11-01 10:18:53
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-11-24 15:12:43
* @LastEditTime: 2023-11-24 16:23:41
* @FilePath: /vue-flow-editor/doc/selectUserView.vue
* @Description: 成员列表选择控件
-->
......@@ -53,7 +53,10 @@
:id="item.id"
@click="handleTabClick(item, $event, index)"
>
{{ item.name }}
<el-icon v-if="item.type === 'corp-tree'" style="margin-bottom: 2px;"><House /></el-icon>
<el-icon v-if="item.type === 'role-list'" style="margin-bottom: 2px;"><Female /></el-icon>
<el-icon v-if="item.type === 'user-tree'" style="margin-bottom: 2px;"><User /></el-icon>
<span style="margin-left: 5px;">{{ item.name }}</span>
</div>
</div>
</div>
......@@ -106,6 +109,25 @@
</el-col>
</el-row>
</div>
<div v-if="item.id === activeTabId && item.type === 'role-list'">
<el-row>
<el-col :span="24" style="max-height: 300px; overflow: scroll;">
<el-checkbox-group
class="flow-checkbox-group"
v-model="checkedUserList"
>
<el-checkbox
v-for="(user, idx) in userList"
:key="idx"
:label="user.id"
:disabled="user.disabled"
@change="handleCheckedUserListChange(user, $event)"
>{{ user.name }}</el-checkbox
>
</el-checkbox-group>
</el-col>
</el-row>
</div>
<!-- 成员选择树 -->
<div v-if="item.id === activeTabId && item.type === 'user-tree'">
<el-row>
......@@ -142,25 +164,6 @@
</el-col>
</el-row>
</div>
<div v-if="item.id === activeTabId && item.type === 'role-list'">
<el-row>
<el-col :span="24" style="max-height: 300px; overflow: scroll;">
<el-checkbox-group
class="flow-checkbox-group"
v-model="checkedUserList"
>
<el-checkbox
v-for="(user, idx) in userList"
:key="idx"
:label="user.id"
:disabled="user.disabled"
@change="handleCheckedUserListChange(user, $event)"
>{{ user.name }}</el-checkbox
>
</el-checkbox-group>
</el-col>
</el-row>
</div>
<!-- TAG: 暂时不使用左右选择结构 -->
<!-- <div v-if="item.id === activeTabId && item.type === ''">
<el-tabs
......@@ -302,17 +305,17 @@ const userTabs = ref([
data: []
},
{
id: "tab-role",
name: "角色",
type: "role-list",
data: []
},
{
id: "tab-uer",
name: "成员",
type: "user-tree",
data: []
},
{
id: "tab-role",
name: "角色",
type: "role-list",
data: []
}
]);
const tabSelectData = ref([]);
const tabCheckedData = ref({}); // 保存选中Tab的数据
......@@ -382,7 +385,13 @@ watch(() => {
if (props.visible) {
dialogUserFormVisible.value = true;
// 同步显示tag框选中的用户
checkTab(tabCheckedData.value);
// checkTab(tabCheckedData.value);
if (!tabCheckedData.value.type) { // 未点击过tab栏,默认设置组织结构项
nextTick(() => {
// 把用户选中的节点注入树结构显示选中状态
corpTreeRef.value.setCheckedKeys(userTags.value.map(ele => ele.id), false)
});
}
} else {
dialogUserFormVisible.value = false;
// 用户选择弹框关闭时,清空数据
......@@ -603,12 +612,14 @@ const handleCheckedUserListChange = (user, checked) => {
}
// 适配搜索栏结果的勾选显示
const element = searchUserList.value[user.type];
if (element) {
for (let index = 0; index < element.length; index++) {
const ele = element[index];
if (user.id === ele.id) {
ele.checked = checked;
}
}
}
};
/**
......