Commit 609aa0c2 authored by 赵伟庚's avatar 赵伟庚

update: 需求优化内容,能力推荐交互优化

parent 5b5c2472
...@@ -11,8 +11,9 @@ ...@@ -11,8 +11,9 @@
:indeterminate="option.isIndeterminate" :indeterminate="option.isIndeterminate"
@change="changeSelf" @change="changeSelf"
> >
<span :title="option.name"> <span :title="option.name + (option.remark ? `(${option.remark})` : '')">
{{ option.name }} {{ option.name }}
{{option.remark ? `(${option.remark})` : ""}}
</span> </span>
</el-checkbox> </el-checkbox>
</div> </div>
......
...@@ -98,6 +98,7 @@ export default { ...@@ -98,6 +98,7 @@ export default {
name: nameProp, name: nameProp,
value: valueProp, value: valueProp,
children: childrenProp, children: childrenProp,
remark: remarkProp,
} = this.props; } = this.props;
let permissionData = []; let permissionData = [];
let traverseOptions = (item) => { let traverseOptions = (item) => {
...@@ -107,9 +108,11 @@ export default { ...@@ -107,9 +108,11 @@ export default {
let children = item[childrenProp]; let children = item[childrenProp];
let isSelected = this.values.indexOf(value) > -1; let isSelected = this.values.indexOf(value) > -1;
let isIndeterminate = false; let isIndeterminate = false;
let remark = item[remarkProp];
result.name = name; result.name = name;
result.value = value; result.value = value;
result.remark = remark;
if (children && children.length > 0) { if (children && children.length > 0) {
......
...@@ -2565,7 +2565,7 @@ a { ...@@ -2565,7 +2565,7 @@ a {
text-overflow: ellipsis; text-overflow: ellipsis;
word-break: break-all; word-break: break-all;
white-space: nowrap; white-space: nowrap;
width: 8em; width: 10em;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
line-height: 16px; line-height: 16px;
......
<template> <template>
<div class="item_card"> <div class="item_card" :style="{'height':props.flag ? '242px' : '206px'}">
<div class="action_box" v-if="props.flag"> <div class="action_box" v-if="props.flag">
<div class="can_click_text" @click="deleteItem(props.item)">删除</div> <div class="can_click_text" @click="deleteItem(props.item)">删除</div>
<div class="can_click_text" @click="move(1)" :class="props.item.canDown ? '' : 'disabled'">下移</div> <div class="can_click_text" @click="move(1)" :class="props.item.canDown ? '' : 'disabled'">下移</div>
<div class="can_click_text" @click="move(2)" :class="props.item.canUp ? '' : 'disabled'">上移</div> <div class="can_click_text" @click="move(2)" :class="props.item.canUp ? '' : 'disabled'">上移</div>
</div> </div>
<div class="top_info"> <div class="top_info" :style="{'padding-left': !props.flag ? '8px' : '24px'}">
<el-checkbox <el-checkbox
v-if="!props.flag"
class="select_box" class="select_box"
v-model="props.item.checked" v-model="props.item.checked"
@change="change_check" @change="change_check"
...@@ -54,7 +55,7 @@ ...@@ -54,7 +55,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="bottom_info"> <div class="bottom_info" :style="{'height':props.flag ? 'calc(100% - 128px)' : 'calc(100% - 92px)'}">
<div class="desc" :title="props.item.synopsis"> <div class="desc" :title="props.item.synopsis">
{{props.item.synopsis}} {{props.item.synopsis}}
</div> </div>
...@@ -112,8 +113,8 @@ const move = (type) => { ...@@ -112,8 +113,8 @@ const move = (type) => {
<style lang="scss" scoped> <style lang="scss" scoped>
.item_card { .item_card {
width: 100%; width: 384px;
margin-right: 16px; // margin-right: 16px;
margin-bottom: 16px; margin-bottom: 16px;
height: 206px; height: 206px;
background-color: #ffffff; background-color: #ffffff;
...@@ -129,6 +130,8 @@ const move = (type) => { ...@@ -129,6 +130,8 @@ const move = (type) => {
display: flex; display: flex;
line-height: 36px; line-height: 36px;
flex-direction: row-reverse; flex-direction: row-reverse;
border-radius: 6px 6px 0 0;
font-size: 14px;
.can_click_text { .can_click_text {
margin-right: 16px; margin-right: 16px;
} }
......
<template> <template>
<div class="card_list"> <div class="card_list">
<div v-for="(e,i) in props.list" :key="'card' + i" class="item" style="width: calc((100% - 32px) / 3)"> <div v-for="(e,i) in props.list" :key="'card' + i" class="item">
<ability-card v-if="e.id" :item="e" @change_check="changeCheck" :flag="props.flag" @deleteItem="deleteItem" @move="move"/> <ability-card v-if="e.id" :item="e" @change_check="changeCheck" :flag="props.flag" @deleteItem="deleteItem" @move="move"/>
<div v-else class="empty_card" @click="open"> <div v-else class="empty_card" @click="open">
<span>+</span> <span>+</span>
...@@ -39,12 +39,15 @@ const move = (temp) => { ...@@ -39,12 +39,15 @@ const move = (temp) => {
<style lang="scss" scoped> <style lang="scss" scoped>
.card_list { .card_list {
width: 100%;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between; // transform: translateX(-16px);
// .item { // justify-content: space-between;
// width: calc(100% - 32px); .item {
// } // width: calc((100% - 32px) / 3);
margin-left: 16px;
}
.empty_card { .empty_card {
cursor: pointer; cursor: pointer;
width: 384px; width: 384px;
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
> >
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input <el-input
v-model="formData.name" v-model.trim="formData.name"
show-word-limit show-word-limit
:maxlength=" :maxlength="
nodeClassifyId == 'eb9c7d70-c123-42b7-8e61-dde1b022b669' nodeClassifyId == 'eb9c7d70-c123-42b7-8e61-dde1b022b669'
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</div> </div>
<div> <div>
<div class="title"> <div class="title">
<div><span class="icon_box"></span> 基础信息</div> <div><span class="icon_box"></span> 联系人信息</div>
<div class="dashed_line"> <div class="dashed_line">
</div> </div>
</div> </div>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
class="menu_form" class="menu_form"
> >
<el-form-item label="菜单名称" prop="menu_name"> <el-form-item label="菜单名称" prop="menu_name">
<el-input v-model="menuForm.menu_name" show-word-limit maxlength="8" placeholder="请输入菜单名称" /> <el-input v-model.trim="menuForm.menu_name" show-word-limit maxlength="8" placeholder="请输入菜单名称" />
</el-form-item> </el-form-item>
<el-form-item label="类型" prop="menu_type" v-if="!topLevel"> <el-form-item label="类型" prop="menu_type" v-if="!topLevel">
<el-radio-group v-model="menuForm.menu_type" :disabled="radioDisabled"> <el-radio-group v-model="menuForm.menu_type" :disabled="radioDisabled">
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
inline-prompt inline-prompt
active-text="是" active-text="是"
inactive-text="否" inactive-text="否"
:disabled="disabledSwitch"
/> />
</el-form-item> </el-form-item>
<el-form-item label="菜单路径" :prop="topLevel ? '' : 'menu_url'"> <el-form-item label="菜单路径" :prop="topLevel ? '' : 'menu_url'">
...@@ -174,6 +175,7 @@ const state = reactive({ ...@@ -174,6 +175,7 @@ const state = reactive({
topLevel: false, topLevel: false,
typeDisFlag: null, typeDisFlag: null,
groupFlag: true, groupFlag: true,
disabledSwitch: false, // 内置菜单built_in为1-不可禁用 0或不存在-可禁用
}) })
const getGroupList = () => { const getGroupList = () => {
...@@ -244,6 +246,7 @@ const setForm = (data) => { ...@@ -244,6 +246,7 @@ const setForm = (data) => {
}else { }else {
state.radioDisabled = false state.radioDisabled = false
} }
state.disabledSwitch = data.built_in && data.built_in == 1 ? true : false
state.menuForm = Object.assign(state.menuForm, data); state.menuForm = Object.assign(state.menuForm, data);
} // 表单赋值 } // 表单赋值
...@@ -281,6 +284,7 @@ const { ...@@ -281,6 +284,7 @@ const {
typeDisFlag, typeDisFlag,
groupFlag, groupFlag,
systemGroupList, systemGroupList,
disabledSwitch,
} = toRefs(state) } = toRefs(state)
defineExpose({ setForm , menuForm, menuRef }) defineExpose({ setForm , menuForm, menuRef })
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<type-form ref="typeFormRef" @action="submitFormData" @changeType="changeType"></type-form> <type-form ref="typeFormRef" @action="submitFormData" @changeType="changeType"></type-form>
<div class="ability_select"> <div class="ability_select">
<div class="title"> <div class="title">
<span>已选择能力(0/9)</span> <span>已选择能力({{selectArrNew.length}}/9)</span>
<el-tooltip <el-tooltip
class="box-item" class="box-item"
effect="light" effect="light"
...@@ -18,13 +18,7 @@ ...@@ -18,13 +18,7 @@
</el-tooltip> </el-tooltip>
</div> </div>
<div class="select_arr"> <div class="select_arr">
<!-- <div v-for="(item,i) in selectArr" :key="'select' +i">
</div> -->
<ability-list :list="selectArr" :flag="true" @openBox="openDialog" @deleteItem="deleteItem" @move="move"></ability-list> <ability-list :list="selectArr" :flag="true" @openBox="openDialog" @deleteItem="deleteItem" @move="move"></ability-list>
<!-- <div v-for="(e,i) in (9 - selectArr.length)" :key="'empty' +i" class="empty_card" @click="openDialog">
<span>+</span>
</div> -->
</div> </div>
</div> </div>
<div class="state_box"> <div class="state_box">
...@@ -98,7 +92,7 @@ ...@@ -98,7 +92,7 @@
</div> </div>
<div> <div>
<span>已选择</span> <span>已选择</span>
<span class="num">({{selection.length}}/9)</span> <span class="num">({{selectArrNew.length}}/9)</span>
<span></span> <span></span>
<span class="can_click_text" @click="clearSelection">清空</span> <span class="can_click_text" @click="clearSelection">清空</span>
</div> </div>
...@@ -142,8 +136,8 @@ const route = useRoute() ...@@ -142,8 +136,8 @@ const route = useRoute()
const typeFormRef = ref(null); const typeFormRef = ref(null);
const state = reactive({ const state = reactive({
formData: { formData: {
type: "", business_type_id: "",
icon: [], logo: [],
state: 1 state: 1
}, },
emptyArr: ["","","","","","","","",""], emptyArr: ["","","","","","","","",""],
...@@ -191,8 +185,54 @@ const state = reactive({ ...@@ -191,8 +185,54 @@ const state = reactive({
value:3, value:3,
}, },
], ],
selection: [], list: [],
list: [ selectArrNew: []
})
const getDetail = (id) => {
// axios
// .get(`/apaas/system/v5/banner/${id}`)
// .then(res => {
// if (res.data.code == 200) {
// const data = res.data.data
// typeFormRef.value.setForm({
// business_type_id: data.business_type_id,
// logo: data.logo ? [{url: data.logo}] : [],
// })
// state.formData.state = data.state
// }else {
// ElMessage.error(res.data.data)
// }
// })
// .catch(err => {
// console.log(err)
// })
}
const getOrgList = () => {
axios
.get(`/apaas/system/v5/org/tree`)
.then((res) => {
if (res.data.code == 200) {
state.orgList = res.data.data || []
}else {
ElMessage.error(res.data.data)
}
})
} // 获取组织列表
const changeType = (val) => {
state.formData.business_type_id = val
state.selectArr = ["","","","","","","","",""]
state.selectArrNew = []
}
const getAbilityList = () => {
let params = {
...state.dialogFilter,
business_type_id: state.formData.business_type_id
}
console.log(params)
state.list= [
{ {
ability_logo: "", ability_logo: "",
ability_name: "冒烟测试1冒烟测试冒烟测试12101", ability_name: "冒烟测试1冒烟测试冒烟测试12101",
...@@ -206,6 +246,7 @@ const state = reactive({ ...@@ -206,6 +246,7 @@ const state = reactive({
openness: "开放", openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311", openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9, score: 1.9,
ability_id: "5228116e-db80-42ed-9c31-5d681ed434ca",
sort_weight: 228.2733180765668, sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101", synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
}, },
...@@ -224,6 +265,7 @@ const state = reactive({ ...@@ -224,6 +265,7 @@ const state = reactive({
score: 1.9, score: 1.9,
sort_weight: 228.2733180765668, sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101", synopsis: "冒烟测试112101",
ability_id: "cf7d0496-9b65-460a-ba07-82ae10fbbe3d",
}, },
{ {
ability_logo: "", ability_logo: "",
...@@ -240,6 +282,7 @@ const state = reactive({ ...@@ -240,6 +282,7 @@ const state = reactive({
score: 1.9, score: 1.9,
sort_weight: 228.2733180765668, sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101", synopsis: "冒烟测试112101",
ability_id: "00c5fc87-861e-4a58-ade5-03058364ad1e",
}, },
{ {
ability_logo: "", ability_logo: "",
...@@ -255,64 +298,196 @@ const state = reactive({ ...@@ -255,64 +298,196 @@ const state = reactive({
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311", openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9, score: 1.9,
sort_weight: 228.2733180765668, sort_weight: 228.2733180765668,
ability_id: "e71240fe-2305-4637-bbb5-316f2cdb77ee",
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101", synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
}, },
], {
selectArrNew: [] ability_logo: "",
}) ability_name: "冒烟测试1冒烟测试冒烟测试12101",
ability_type: 0,
const getDetail = (id) => { browse_count: 118,
// axios call_count: 666,
// .get(`/apaas/system/v5/banner/${id}`) develop: "比格",
// .then(res => { develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
// if (res.data.code == 200) { id: 5,
// const data = res.data.data include_mock_service: true,
// typeFormRef.value.setForm({ openness: "开放",
// type: data.banner_name, openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
// icon: data.banner_image ? [{url: data.banner_image}] : [], ability_id: "ea1488f5-3912-4c83-8b38-98a7dcdafc5f",
// }) score: 1.9,
// state.formData.state = data.state sort_weight: 228.2733180765668,
// }else { synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
// ElMessage.error(res.data.data) },
// } {
// }) ability_logo: "",
// .catch(err => { ability_name: "冒烟测试1冒烟测试冒烟测试12101",
// console.log(err) ability_type: 0,
// }) browse_count: 118,
} call_count: 666,
develop: "比格",
const getOrgList = () => { develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
axios ability_id: "70c371d3-7b7a-4c66-a40f-30d83ac567b3",
.get(`/apaas/system/v5/org/tree`) id: 6,
.then((res) => { include_mock_service: true,
if (res.data.code == 200) { openness: "开放",
console.log(res.data.data) openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
state.orgList = res.data.data || [] score: 1.9,
}else { sort_weight: 228.2733180765668,
ElMessage.error(res.data.data) synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
} },
{
ability_logo: "",
ability_name: "冒烟测试1冒烟测试冒烟测试12101",
ability_type: 0,
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
ability_id: "346237c3-9c21-4cf8-ae1d-3d8692ad0255",
id: 7,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9,
sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
},
{
ability_logo: "",
ability_name: "冒烟测试1冒烟测试冒烟测试12101",
ability_type: 0,
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
ability_id: "f8039680-7978-4561-982d-96b799459368",
id: 8,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9,
sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
},
{
ability_logo: "",
ability_name: "冒烟测试1冒烟测试冒烟测试12101",
ability_type: 0,
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
id: 9,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9,
sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
},
{
ability_logo: "",
ability_name: "冒烟测试1冒烟测试冒烟测试12101",
ability_type: 0,
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
id: 10,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9,
sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
},
{
ability_logo: "",
ability_name: "冒烟测试1冒烟测试冒烟测试12101",
ability_type: 0,
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
id: 11,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9,
sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
},
{
ability_logo: "",
ability_name: "冒烟测试1冒烟测试冒烟测试12101",
ability_type: 0,
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
id: 12,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9,
sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
},
{
ability_logo: "",
ability_name: "冒烟测试1冒烟测试冒烟测试12101",
ability_type: 0,
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
id: 13,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9,
sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
},
{
ability_logo: "",
ability_name: "冒烟测试1冒烟测试冒烟测试12101",
ability_type: 0,
browse_count: 118,
call_count: 666,
develop: "比格",
develop_id: "0e9f31d8-117c-4be4-bdfb-9af1bddd852e",
id: 14,
include_mock_service: true,
openness: "开放",
openness_id: "9de06ba6-6ee2-4449-91d9-31a1c7554311",
score: 1.9,
sort_weight: 228.2733180765668,
synopsis: "冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101冒烟测试112101",
},
]
state.selectArrNew = []
nextTick(() => {
state.list.forEach(e => {
e.checked = false
state.selectArr.forEach(k => {
if (k.id) {
if (e.id == k.id) {
e.checked = true
state.selectArrNew.push(e)
}
}
})
}) })
} // 获取组织列表 })
const changeType = (val) => {
state.formData.type = val
}
const getAbilityList = () => {
let params = {
...state.dialogFilter,
type: state.formData.type
}
console.log(params)
} }
const openDialog = () => { const openDialog = () => {
console.log(123123123)
state.selectDialog = true state.selectDialog = true
getAbilityList() getAbilityList()
} }
const deleteItem = (item) => { const deleteItem = (item) => {
console.log(item)
changeCheck(item,true) changeCheck(item,true)
} }
...@@ -331,6 +506,18 @@ const move = (temp) => { ...@@ -331,6 +506,18 @@ const move = (temp) => {
state.selectArr[index] = state.selectArr[index-1] state.selectArr[index] = state.selectArr[index-1]
state.selectArr[index-1] = temp.item state.selectArr[index-1] = temp.item
} }
state.selectArr.forEach((e,i) => {
if (e != '') {
e.canDown = true
e.canUp = true
if (i == 0) {
e.canUp = false
}
if (i == state.selectArrNew.length - 1) {
e.canDown = false
}
}
})
} }
const changePage = (val) => { const changePage = (val) => {
state.dialogFilter.page = 1 state.dialogFilter.page = 1
...@@ -347,7 +534,10 @@ const changeCollation = (val) => { ...@@ -347,7 +534,10 @@ const changeCollation = (val) => {
} }
const clearSelection = () => { const clearSelection = () => {
state.selection = [] state.list.forEach(e => {
e.checked = false
})
state.selectArrNew = []
} }
const searchAction = () => { const searchAction = () => {
console.log(state.dialogFilter) console.log(state.dialogFilter)
...@@ -364,7 +554,7 @@ const clearAction = () => { ...@@ -364,7 +554,7 @@ const clearAction = () => {
} }
const changeCheck = (item,deleteFlag) => { const changeCheck = (item,deleteFlag) => {
let arr = state.selectArr.map(e => e.id) || [] let arr = state.selectArrNew.map(e => e.id) || []
if (arr.indexOf(item.id) > -1) { if (arr.indexOf(item.id) > -1) {
state.selectArrNew.splice(arr.indexOf(item.id),1) state.selectArrNew.splice(arr.indexOf(item.id),1)
}else { }else {
...@@ -389,55 +579,73 @@ const submit = () => { ...@@ -389,55 +579,73 @@ const submit = () => {
} }
const conform = () => { const conform = () => {
if (state.selectArrNew.length > 9) {
ElMessage.error("最多可选择9个能力")
return
}
state.selectArr = JSON.parse(JSON.stringify(state.selectArrNew)) state.selectArr = JSON.parse(JSON.stringify(state.selectArrNew))
console.log(state.selectArr)
if (state.selectArr.length < 9) { if (state.selectArr.length < 9) {
let arr = [] let arr = []
for (var i = 0; i < 9-state.selectArr.length; i++ ) { for (var i = 0; i < 9-state.selectArr.length; i++ ) {
arr.push("") arr.push("")
} }
state.selectArr.push(...arr) state.selectArr.push(...arr)
console.log(state.selectArr)
} }
state.selectDialog = false state.selectDialog = false
} }
const submitFormData = (data) => { const submitFormData = (data) => {
if (state.selectArrNew.length < 6) {
ElMessage.error("最少选择6个能力")
return
}
if (data) { if (data) {
Object.assign(state.formData,data); Object.assign(state.formData,data);
console.log(state.formData) console.log(state.formData)
if (route.query.id) { if (route.query.id) {
// 编辑 // 编辑
let abilitys = []
state.selectArrNew.forEach(e => {
abilitys.push(e.ability_id)
})
let params = { let params = {
...state.formData, ...state.formData,
id: +route.query.id id: +route.query.id,
abilitys: abilitys
} }
params.icon = params.icon && params.icon.length > 0 ? params.icon[0].url : '' params.logo = params.logo && params.logo.length > 0 ? params.logo[0].url : ''
// axios console.log(params)
// .put(`/apaas/system/v5/banner`,params) axios
// .then(res => { .post(`/apaas/system/v5/recommend/ability/update`,params)
// if (res.data.code == 200) { .then(res => {
// ElMessage.success(res.data.msg) if (res.data.code == 200) {
// router.go(-1) ElMessage.success(res.data.msg)
// }else { router.go(-1)
// ElMessage.error(res.data.data) }else {
// } ElMessage.error(res.data.data)
// }) }
})
}else { }else {
let abilitys = []
state.selectArrNew.forEach(e => {
abilitys.push(e.ability_id)
})
let params = { let params = {
...state.formData, ...state.formData,
abilitys: abilitys
} }
params.icon = params.icon && params.icon.length > 0 ? params.icon[0].url : '' params.logo = params.logo && params.logo.length > 0 ? params.logo[0].url : ''
// axios console.log(params)
// .post(`/apaas/system/v5/banner`,params) axios
// .then(res => { .post(`/apaas/system/v5/recommend/ability/add`,params)
// if (res.data.code == 200) { .then(res => {
// ElMessage.success(res.data.msg) if (res.data.code == 200) {
// router.go(-1) ElMessage.success(res.data.msg)
// }else { router.go(-1)
// ElMessage.error(res.data.data) }else {
// } ElMessage.error(res.data.data)
// }) }
})
} }
} }
} }
...@@ -465,6 +673,7 @@ const { ...@@ -465,6 +673,7 @@ const {
collationArr, collationArr,
selection, selection,
list, list,
selectArrNew,
} = toRefs(state) } = toRefs(state)
</script> </script>
...@@ -510,23 +719,21 @@ const { ...@@ -510,23 +719,21 @@ const {
} }
} }
.select_arr { .select_arr {
width: 1200px; width: 1216px;
display: flex; transform: translateX(-16px);
flex-wrap: wrap; // .empty_card {
justify-content: space-between; // cursor: pointer;
.empty_card { // width: 384px;
cursor: pointer; // height: 242px;
width: 384px; // border: 1px dashed #dadee7;
height: 242px; // border-radius: 4px;
border: 1px dashed #dadee7; // margin-bottom: 24px;
border-radius: 4px; // color: #dadee7;
margin-bottom: 24px; // text-align: center;
color: #dadee7; // line-height: 242px;
text-align: center; // font-size: 48px;
line-height: 242px; // font-weight: 100;
font-size: 48px; // }
font-weight: 100;
}
} }
} }
.state_box { .state_box {
...@@ -624,18 +831,8 @@ const { ...@@ -624,18 +831,8 @@ const {
} }
.user_table { .user_table {
max-height: calc(100% - 31px); max-height: calc(100% - 31px);
padding: 0 16px; // padding: 0 16px;
:deep().bg-table { // padding-left: 16px;
.el-scrollbar {
--el-scrollbar-bg-color: #fff
}
.el-table__empty-block {
.empty_container {
height: calc(100% - 45px);
}
}
}
} }
} }
} }
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
style="max-width: 1048px" style="max-width: 1048px"
class="form" class="form"
> >
<el-form-item label="能力类型" prop="type"> <el-form-item label="能力类型" prop="business_type_id">
<el-select v-model="formData.type" placeholder="请选择能力类型" style="width: 100%" @change="changeType"> <el-select v-model="formData.business_type_id" placeholder="请选择能力类型" style="width: 100%" @change="changeType">
<el-option <el-option
v-for="item in TypeList" v-for="item in TypeList"
:key="item.dict_id" :key="item.dict_id"
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="上传图标" prop="icon"> <el-form-item label="上传图标" prop="logo">
<bg-upload-image v-model="formData.icon" :fileSize="500" :fileSizeUnit="'KB'" :showTips="true" customTips="请选择图片上传:大小36 * 36像素支持jpg、png等格式,图片需小于500KB" :limit="1" listType="picture-card" :accept="['.jpg','.jpeg','.png']"></bg-upload-image> <bg-upload-image v-model="formData.logo" :fileSize="500" :fileSizeUnit="'KB'" :showTips="true" customTips="请选择图片上传:大小36 * 36像素支持jpg、png等格式,图片需小于500KB" :limit="1" listType="picture-card" :accept="['.jpg','.jpeg','.png']"></bg-upload-image>
</el-form-item> </el-form-item>
</el-form> </el-form>
</template> </template>
...@@ -32,14 +32,14 @@ const route = useRoute() ...@@ -32,14 +32,14 @@ const route = useRoute()
const form = ref(null) const form = ref(null)
const state = reactive({ const state = reactive({
formData: { formData: {
type: "", business_type_id: "",
icon: [], logo: [],
}, },
formRules: { formRules: {
type: [ business_type_id: [
{ required: true, message: '请选择业务类型', trigger: 'change' }, { required: true, message: '请选择业务类型', trigger: 'change' },
], ],
icon: [ logo: [
{ required: true, message: '请上传图标', trigger: 'change' }, { required: true, message: '请上传图标', trigger: 'change' },
], ],
}, },
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
class="role_form" class="role_form"
> >
<el-form-item prop="role_name" label="角色名称"> <el-form-item prop="role_name" label="角色名称">
<el-input v-model="formData.role_name" maxlength="50" show-word-limit :disabled="rowType != 0" /> <el-input v-model.trim="formData.role_name" maxlength="50" show-word-limit :disabled="rowType != 0" />
</el-form-item> </el-form-item>
<el-form-item prop="role_desc" label="描述"> <el-form-item prop="role_desc" label="描述">
<el-input <el-input
...@@ -117,6 +117,7 @@ const roleState = reactive({ ...@@ -117,6 +117,7 @@ const roleState = reactive({
name: 'menu_name', name: 'menu_name',
value: 'id', value: 'id',
children: 'Child', children: 'Child',
remark: 'remark',
}, // 菜单框默认配置 }, // 菜单框默认配置
permissionData: [], // 菜单数据 permissionData: [], // 菜单数据
rowType: 0, rowType: 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment