From 3d9996841bfb96e143062b46bfedeb906f50df58 Mon Sep 17 00:00:00 2001 From: liudong <liudong> Date: 星期三, 07 八月 2024 18:25:34 +0800 Subject: [PATCH] 配置bug页面修改 --- src/views/authority/resource/index.vue | 111 +++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 87 insertions(+), 24 deletions(-) diff --git a/src/views/authority/resource/index.vue b/src/views/authority/resource/index.vue index 3efc9c1..1ea12c6 100644 --- a/src/views/authority/resource/index.vue +++ b/src/views/authority/resource/index.vue @@ -3,8 +3,12 @@ <authheader :items="menuTips"></authheader> <a-row :gutter="20"> <a-col :span="8"> - <a-card :title="$t('menu.resource.title')" :bordered="false" - :style="{ width: '100%',height: '900px', 'overflow-y': 'auto' }"> + <a-card + :title="$t('menu.resource.title')" + :bordered="false" + :style="{ 'width': '100%', 'height': '900px', 'overflow-y': 'auto' }" + > + <a-button @click="() => onIconClick(null)">鏂板鐖剁骇鑿滃崟</a-button> <a-tree class="tree-demo" draggable @@ -12,47 +16,75 @@ :data="treeData" :show-line="showLine" :fieldNames="{ - key:'menuId', - title:'menuName', - children:'children', + key: 'menuId', + title: 'menuName', + children: 'children', }" @drop="onDrop" @select="showDetail" > <template #extra="nodeData"> <IconPlus - style="position: absolute; right: 60px; font-size: 12px; top: 10px; color: #3370ff;" + style=" + position: absolute; + right: 60px; + font-size: 12px; + top: 10px; + color: #3370ff; + " @click="() => onIconClick(nodeData)" /> - <IconDelete style="position: absolute; right: 40px; font-size: 12px; top: 10px; color: #3370ff;" - @click="() => onIconClickDelete(nodeData)" /> + <IconDelete + style=" + position: absolute; + right: 40px; + font-size: 12px; + top: 10px; + color: #3370ff; + " + @click="() => onIconClickDelete(nodeData)" + /> </template> </a-tree> - </a-card> </a-col> <a-col :span="16"> - <a-card :title="$t('menu.resource.detail')" :bordered="false" :style="{ width: '100%' }"> + <a-card + :title="$t('menu.resource.detail')" + :bordered="false" + :style="{ width: '100%' }" + > <a-form :model="resourceform" layout="horizontal"> <a-form-item field="parentName" label="涓婄骇璧勬簮" disabled> <a-input v-model="resourceform.parentName" /> </a-form-item> <a-form-item field="status" label="璧勬簮鐘舵��"> - <a-switch checked-value="0" unchecked-value="1" v-model="resourceform.status"></a-switch> + <a-switch + checked-value="0" + unchecked-value="1" + v-model="resourceform.status" + ></a-switch> </a-form-item> <a-form-item field="menuName" label="璧勬簮鍚嶇О"> <a-input v-model="resourceform.menuName" /> </a-form-item> <a-form-item field="menuType" label="璧勬簮绫诲瀷"> - <a-select v-model="resourceform.menuType" :options="options" :field-names="fieldNames" - :style="{width:'320px'}" - placeholder="璇烽�夋嫨" /> - + <a-select + v-model="resourceform.menuType" + :options="options" + :field-names="fieldNames" + :style="{ width: '320px' }" + placeholder="璇烽�夋嫨" + /> </a-form-item> <a-form-item field="perms" label="璧勬簮鎺у埗鏉冮檺瀛楃"> <a-input v-model="resourceform.perms" /> </a-form-item> - <a-form-item field="component" label="璧勬簮鍦板潃" style="align: start"> + <a-form-item + field="component" + label="璧勬簮鍦板潃" + style="align: start" + > <a-input v-model="resourceform.component" /> </a-form-item> <a-form-item> @@ -65,21 +97,35 @@ </a-card> </a-col> </a-row> - <a-modal width="50%" v-model:visible="visible" title="鏂板" @cancel="handleCancel" @ok="addresource"> + <a-modal + width="50%" + v-model:visible="visible" + title="鏂板" + @cancel="handleCancel" + @ok="addresource" + > <a-form :model="resourceform" layout="horizontal"> <a-form-item field="parentName" label="涓婄骇璧勬簮" disabled> <a-input v-model="resourceform.parentName" /> </a-form-item> <a-form-item field="status" label="璧勬簮鐘舵��"> - <a-switch checked-value="0" unchecked-value="1" v-model="resourceform.status"></a-switch> + <a-switch + checked-value="0" + unchecked-value="1" + v-model="resourceform.status" + ></a-switch> </a-form-item> <a-form-item field="menuName" label="璧勬簮鍚嶇О"> <a-input v-model="resourceform.menuName" /> </a-form-item> <a-form-item field="menuType" label="璧勬簮绫诲瀷"> - <a-select v-model="resourceform.menuType" :options="options" :field-names="fieldNames" - :style="{width:'320px'}" - placeholder="璇烽�夋嫨" /> + <a-select + v-model="resourceform.menuType" + :options="options" + :field-names="fieldNames" + :style="{ width: '320px' }" + placeholder="璇烽�夋嫨" + /> </a-form-item> <a-form-item field="perms" label="璧勬簮鎺у埗鏉冮檺瀛楃"> <a-input v-model="resourceform.perms" /> @@ -140,7 +186,23 @@ }); const onIconClick = (nodeData) => { - resourceform.value.parentId = nodeData.menuId; + if (nodeData) { + resourceform.value.parentId = nodeData.menuId; + resourceform.value.parentName = nodeData.menuName; + } + resourceform.value.component = ""; + resourceform.value.createTime = ""; + resourceform.value.description = ""; + resourceform.value.icon = ""; + resourceform.value.menuId = ""; + resourceform.value.menuName = ""; + resourceform.value.menuType = ""; + resourceform.value.orderNum = "0"; + resourceform.value.path = ""; + resourceform.value.perms = ""; + resourceform.value.status = ""; + resourceform.value.syesourcetype = ""; + visible.value = true; }; @@ -183,7 +245,9 @@ const onDrop = ({ dragNode, dropNode, dropPosition }) => { const data = treeData.value; ResourceUpdate({ - orderNum: "0", parentId: dropNode.menuId, menuId: dragNode.menuId + orderNum: "0", + parentId: dropNode.menuId, + menuId: dragNode.menuId }); const loop = (data, key, callback) => { data.some((item, index, arr) => { @@ -228,7 +292,6 @@ ResourceData(""); </script> - <style scoped> .tree-demo :deep(.tree-node-dropover) > :deep(.arco-tree-node-title), -- Gitblit v1.8.0