@@ -61,7 +61,7 @@ | |||
</div> | |||
</template> | |||
<script lang="ts"> | |||
<script> | |||
import SlideImgThreePng from '@/assets/image/slide_img_three.png'; | |||
//md开撸第二版 | |||
export default { |
@@ -62,6 +62,7 @@ const hintDelete = (scope: any, data: any) => { | |||
let toolData: any = [] | |||
data.forEach((element: any, index: number) => { | |||
if (props.rowKey) { | |||
if (scope.row[props.rowKey] === element.title) { | |||
element.visible = true | |||
} else { |
@@ -173,8 +173,6 @@ const rules = reactive(initRules) | |||
processData.search = {} | |||
//搜索条件 | |||
let searchCondition: any = reactive(processData.search) | |||
console.log(searchCondition); | |||
//表单字段 | |||
const form: any = ref(initForm) |
@@ -14,21 +14,14 @@ | |||
<search-menu /> | |||
<!-- 全屏 --> | |||
<el-icon @click="fullScreen" style="margin: 0px 20px 0px 20px" size="24px" color="#FFFFFF"> | |||
<item-ioc v-if="menuStart.menuIsExpansion" icon="FullScreen" /> | |||
<item-ioc icon="FullScreen" /> | |||
</el-icon> | |||
<!-- 弹出框提示 --> | |||
<el-popover v-model:visible="visible" placement="bottom" :width="160"> | |||
<div class="as-layout-vertical"> | |||
<el-button type="default" @click="hint('个人中心')" class="as-text-14px" style="width: 100%" | |||
>个人中心</el-button | |||
> | |||
<el-button | |||
type="default" | |||
@click="hint('退出登录')" | |||
class="as-text-14px" | |||
style="margin-right: 10px" | |||
>退出登录</el-button | |||
> | |||
<el-button type="default" @click="hint('个人中心')" class="as-text-14px" style="width: 100%">个人中心</el-button> | |||
<el-button type="default" @click="hint('退出登录')" class="as-text-14px" style="margin-right: 10px">退出登录 | |||
</el-button> | |||
</div> | |||
<template #reference> | |||
<!-- 头像 --> | |||
@@ -38,13 +31,8 @@ | |||
</template> | |||
</el-popover> | |||
<!-- 设置 --> | |||
<el-icon | |||
@click="hint('点击了设置')" | |||
style="margin: 0px 30px 0px 30px" | |||
size="24px" | |||
color="#FFFFFF" | |||
> | |||
<item-ioc v-if="menuStart.menuIsExpansion" icon="Setting" /> | |||
<el-icon @click="hint('点击了设置')" style="margin: 0px 30px 0px 30px" size="24px" color="#FFFFFF"> | |||
<item-ioc icon="Setting" /> | |||
</el-icon> | |||
</div> | |||
</div> |
@@ -1,5 +1,6 @@ | |||
<template> | |||
<crud-template ref="crud" :home-data="field" :tableData="testData" @submit="submit" @handleEdit="handleEdit"> | |||
<crud-template ref="crud" :home-data="field" :tableData="testData" @add="addData" @submit="submit" | |||
@handleEdit="handleEdit"> | |||
<template #search="{ searchCondition }"> | |||
<el-input v-model="searchCondition.fileTwo" clearable placeholder="输入名称或邮箱名称" style="width: 200px;" /> | |||
<div> | |||
@@ -22,7 +23,7 @@ | |||
<div v-show="false"> | |||
{{ item.sort = Number(item.sort) }} | |||
</div> | |||
<el-input-number class="el-input-number" v-model="item.sort" style="width: 100%;" | |||
<el-input-number :min="0" class="el-input-number" v-model="item.sort" style="width: 100%;" | |||
controls-position="right"> | |||
</el-input-number> | |||
</el-form-item> | |||
@@ -110,13 +111,15 @@ const threeData = [ | |||
}, | |||
] | |||
let item = ref({ | |||
const initItem = { | |||
title: '', | |||
sort: 0, | |||
top: '是', | |||
start: '启用', | |||
section: '' | |||
}) | |||
} | |||
let item: any= ref(initItem) | |||
//编辑事件 | |||
const handleEdit = (idx: any, row: any) => { | |||
@@ -125,6 +128,11 @@ const handleEdit = (idx: any, row: any) => { | |||
item.value = toRaw(row) | |||
} | |||
//添加事件 | |||
const addData = () => { | |||
item.value = initItem | |||
} | |||
//表单校验 | |||
const ruleFormRef: any = ref() | |||
const crud: any = ref() | |||
@@ -156,8 +164,8 @@ const field = { | |||
const submit = () => { | |||
ruleFormRef.value.validate((valid: any, fields: any) => { | |||
if (valid) { | |||
console.log(item, ruleFormRef); | |||
crud.value.reset() | |||
console.log(item.value); | |||
// crud.value.reset() | |||
} else { | |||
return false | |||
} | |||
@@ -172,10 +180,10 @@ const submit = () => { | |||
} | |||
/deep/.el-range-editor.el-input__inner { | |||
display: inline-flex; | |||
align-items: center; | |||
padding: 3px 10px; | |||
height: 33px; | |||
width: 300px; | |||
display: inline-flex; | |||
align-items: center; | |||
padding: 3px 10px; | |||
height: 33px; | |||
width: 300px; | |||
} | |||
</style> |
@@ -1,5 +1,6 @@ | |||
<template> | |||
<crud-template ref="crud" :home-data="field" :tableData="testData" @submit="submit" @handleEdit="handleEdit"> | |||
<crud-template ref="crud" :home-data="field" :tableData="testData" @add="addData" @submit="submit" | |||
@handleEdit="handleEdit"> | |||
<template #search="{ searchCondition }"> | |||
<el-input v-model="searchCondition.fileTwo" clearable placeholder="输入名称或邮箱名称" style="width: 200px;" /> | |||
<div> | |||
@@ -110,13 +111,15 @@ const threeData = [ | |||
}, | |||
] | |||
let item = ref({ | |||
const initItem = { | |||
title: '', | |||
sort: 0, | |||
top: '是', | |||
start: '启用', | |||
section: '' | |||
}) | |||
} | |||
let item: any= ref(initItem) | |||
//编辑事件 | |||
const handleEdit = (idx: any, row: any) => { | |||
@@ -125,6 +128,11 @@ const handleEdit = (idx: any, row: any) => { | |||
item.value = toRaw(row) | |||
} | |||
//添加事件 | |||
const addData = () => { | |||
item.value = initItem | |||
} | |||
//表单校验 | |||
const ruleFormRef: any = ref() | |||
const crud: any = ref() | |||
@@ -155,9 +163,9 @@ const field = { | |||
const submit = () => { | |||
ruleFormRef.value.validate((valid: any, fields: any) => { | |||
if (valid) {[] | |||
console.log(item, ruleFormRef); | |||
crud.value.reset() | |||
if (valid) { | |||
console.log(item.value); | |||
// crud.value.reset() | |||
} else { | |||
return false | |||
} | |||
@@ -172,10 +180,10 @@ const submit = () => { | |||
} | |||
/deep/.el-range-editor.el-input__inner { | |||
display: inline-flex; | |||
align-items: center; | |||
padding: 3px 10px; | |||
height: 33px; | |||
width: 300px; | |||
display: inline-flex; | |||
align-items: center; | |||
padding: 3px 10px; | |||
height: 33px; | |||
width: 300px; | |||
} | |||
</style> |