Commit 588ece13 by 温丽香

页面样式修改

1 parent 31d9e754
Pipeline #3322 passed
in 1 minute 0 seconds
...@@ -8,6 +8,17 @@ export const loginApi = data => axios(POST, FRONT + USER + '/login', data) ...@@ -8,6 +8,17 @@ export const loginApi = data => axios(POST, FRONT + USER + '/login', data)
const PARAMETER = '/parameter' const PARAMETER = '/parameter'
export const getParameter = data => axios(GET, FRONT + PARAMETER + '/query_list', data) export const getParameter = data => axios(GET, FRONT + PARAMETER + '/query_list', data)
export const createParameter = data => axios(POST, FRONT + PARAMETER + '/create', data)
export const deleteParameter = data => axios(GET, FRONT + PARAMETER + '/delete', data)
export const editParameter = data => axios(POST, FRONT + PARAMETER + '/change', data)
const TABLE = '/table' const TABLE = '/table'
export const getTable = data => axios(GET, FRONT + TABLE + '/query_list', data) export const getTable = data => axios(GET, FRONT + TABLE + '/query_list', data)
export const createTable = data => axios(POST, FRONT + TABLE + '/create', data)
export const deleteTable = data => axios(GET, FRONT + TABLE + '/delete', data)
export const insertTable = data => axios(POST, FRONT + TABLE + '/insert', data)
const APPID = '/appid'
export const getApp = data => axios(GET, FRONT + APPID + '/query_list', data)
export const deleteApp = data => axios(GET, FRONT + APPID + '/delete', data)
export const setApp = data => axios(GET, FRONT + APPID + '/set', data)
...@@ -472,6 +472,7 @@ export default class seetaTableIndex extends Vue { ...@@ -472,6 +472,7 @@ export default class seetaTableIndex extends Vue {
::v-deep .el-icon-arrow-down:hover ::v-deep .el-icon-arrow-down:hover
color: #409EFF !important color: #409EFF !important
.any-slot .any-slot
display: inline-block // display: inline-block
vertical-align: middle vertical-align: middle
over-flow: hidden
</style> </style>
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
<div class="page-nav"> <div class="page-nav">
<div class="search-fields"> <div class="search-fields">
<span class="fields">用户名:</span> <span class="fields">用户名:</span>
<st-input width="240px" class="align contents" id="align-input" v-model="deviceName"></st-input> <st-input width="240px" class="align contents" id="align-input" v-model="userName"></st-input>
<!-- <input type="text" id="raw-input" autocomplete="off" class="align contents" :style="{borderColor: borderColor}" placeholder="请输入" @blur="getData" v-model.trim="deviceName" @keyup.enter="getData" @input="checkSearchContent"> --> <!-- <input type="text" id="raw-input" autocomplete="off" class="align contents" :style="{borderColor: borderColor}" placeholder="请输入" @blur="getData" v-model.trim="deviceName" @keyup.enter="getData" @input="checkSearchContent"> -->
<span class="fields">用户角色:</span> <span class="fields">用户角色:</span>
<st-select <st-select
v-model="logLevel" v-model="userRole"
:options="logLevelOptions" :options="logLevelOptions"
size="small" size="small"
style="width: 240px" style="width: 240px"
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</st-select> </st-select>
<span class="fields">创建日期:</span> <span class="fields">创建日期:</span>
<el-date-picker <el-date-picker
v-model="timeSection" v-model="created_at"
type="daterange" type="daterange"
@change="getData" @change="getData"
range-separator="至" range-separator="至"
...@@ -97,13 +97,14 @@ ...@@ -97,13 +97,14 @@
<script> <script>
import browserStorage from '@/services/local-storage' import browserStorage from '@/services/local-storage'
import { rTimeMin } from '@/utils/system.js' import { rTimeMin } from '@/utils/system.js'
import Dialog from '@/helpers/dialog'
export default { export default {
data() { data() {
return { return {
// 查询字段 // 查询字段
deviceName: '', userName: '',
logLevel: '', userRole: '',
timeSection: [], created_at: [],
showDialog: false, showDialog: false,
form: {}, form: {},
logLevelOptions: [ logLevelOptions: [
...@@ -174,8 +175,16 @@ export default { ...@@ -174,8 +175,16 @@ export default {
handleEdit(row) { handleEdit(row) {
this.showDialog = true this.showDialog = true
}, },
handleDelete(row) { async handleDelete(row) {
this.showDialog = true console.log(row)
const confirmDelete = await Dialog.confirm('提示', { message: '是否删除此日志?' })
if (!confirmDelete) return
const res = await this.getData()
if (res) {
Toast.success('操作成功')
this.getData()
}
}, },
checkSearchContent() { checkSearchContent() {
if (this.deviceName && this.deviceName.search(this.formatSearchName) !== -1) { if (this.deviceName && this.deviceName.search(this.formatSearchName) !== -1) {
...@@ -211,6 +220,16 @@ export default { ...@@ -211,6 +220,16 @@ export default {
</script> </script>
<style lang="sass" scoped> <style lang="sass" scoped>
.popup-body
::v-deep.el-form-item
height: 32px
line-height: 32px
::v-deep.el-form-item__label
height: 32px!important
line-height: 32px!important
::v-deep.el-form-item__content
height: 32px!important
line-height: 32px!important
.search-fields .search-fields
::v-deep input ::v-deep input
&::placeholder &::placeholder
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<div slot="operate" slot-scope="row"> <div slot="operate" slot-scope="row">
<span class="operate" v-if="row.number === 1" @click="setHostApp">设置为主应用</span> <span class="operate" v-if="row.number === 1" @click="setHostApp">设置为主应用</span>
<span class="operate" v-else @click="cancelHostApp">取消设置为主应用</span> <span class="operate" v-else @click="cancelHostApp">取消设置为主应用</span>
<span class="operate operate-delete" v-if="row.number">删除</span> <span class="operate operate-delete" @click="handleDelete(row)">删除</span>
</div> </div>
</st-table> </st-table>
</div> </div>
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
</template> </template>
<script> <script>
import Dialog from '@/helpers/dialog'
export default { export default {
data() { data() {
return { return {
...@@ -65,6 +66,17 @@ export default { ...@@ -65,6 +66,17 @@ export default {
// this.getData() // this.getData()
}, },
methods: { methods: {
async handleDelete(row) {
console.log(row)
const confirmDelete = await Dialog.confirm('提示', { message: '是否删除此日志?' })
if (!confirmDelete) return
const res = await this.getData()
if (res) {
Toast.success('操作成功')
this.getData()
}
},
setHostApp() {}, setHostApp() {},
cancelHostApp() {} cancelHostApp() {}
} }
......
...@@ -26,40 +26,40 @@ ...@@ -26,40 +26,40 @@
</div> </div>
<div class="table-list"> <div class="table-list">
<div class="list-content"> <div class="list-content">
<el-table <el-table :max-height="flexHeight"
ref="singleTable" ref="singleTable"
:data="tableData" :data="tableData"
highlight-current-row highlight-current-row
@current-change="handleCurrentChange"
@row-click="rowClick" @row-click="rowClick"
@cell-click="cellClick" @cell-click="cellClick"
style="width: 100%"> style="width: 100%">
<el-table-column label="序号" width="100px"> <el-table-column label="序号" width="100px">
<template slot-scope="scope"> <template slot-scope="scope">
<input type="text" v-model="scope.row.field" @blur="handleBlur"> <!-- <input type="text" v-model="" @blur="handleBlur"> -->
<span style="margin-left: 12px">{{scope.row.field}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-for="(column, index) in tableData[0].columns" :key="index" :label="`列${index + 1}`"> <el-table-column v-for="(column, index) in tableData[0].columns" :key="index" :label="`列${index + 1}`">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="column-box"> <!-- <div class="column-box"> -->
<!-- <div style="display: flex"> --> <div style="display: flex">
<!-- <pack-select v-model="scope.row.columns[index].type" @blur="handleBlur" placeholder="请选择" class="none-display" style="margin-right: 10px"> <pack-select v-model="scope.row.columns[index].type" @blur="handleBlur" placeholder="请选择" class="none-display" style="margin-right: 10px">
<el-option <el-option
v-for="item in typeOptions" v-for="item in typeOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</pack-select> --> </pack-select>
<input type="text" v-model="scope.row.columns[index].value" @blur="handleBlur"> <input type="text" v-model="scope.row.columns[index].value" @blur="handleBlur" placeholder="请输入">
<el-select v-model="scope.row.columns[index].type" placeholder="请选择"> <!-- <el-select v-model="scope.row.columns[index].type" placeholder="请选择">
<el-option <el-option
v-for="item in typeOptions" v-for="item in typeOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select> -->
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -82,11 +82,16 @@ ...@@ -82,11 +82,16 @@
</div> </div>
</div> </div>
</div> </div>
<div class="buttons">
<st-button @click="cancel"><span class="text">{{'取消'}}</span></st-button>
<st-button type="primary" @click="save"><span class="text">{{'保存'}}</span></st-button>
</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import Dialog from '@/helpers/dialog'
export default { export default {
data() { data() {
return { return {
...@@ -129,14 +134,33 @@ export default { ...@@ -129,14 +134,33 @@ export default {
{ type: 'base64', value: '上海市普陀' } { type: 'base64', value: '上海市普陀' }
] ]
}], }],
currentRow: '', total: 34,
total: 34 agoCell: null,
flexHeight: 0
} }
}, },
created() {
this.setFlexHeight()
},
mounted() { mounted() {
// this.getData() this.setFlexHeight()
window.onresize = () => {
setTimeout(() => {
this.setFlexHeight()
}, 10)
}
}, },
methods: { methods: {
cancel() {
this.clearCell(this.agoCell)
},
save() {
this.clearCell(this.agoCell)
},
setFlexHeight() {
const ele = document.getElementsByClassName('list-content') && document.getElementsByClassName('list-content')[0]
this.flexHeight = ele && ele.clientHeight
},
addTableData() { addTableData() {
this.tableData.push({ this.tableData.push({
field: '5', field: '5',
...@@ -147,49 +171,62 @@ export default { ...@@ -147,49 +171,62 @@ export default {
] ]
}) })
}, },
handleDelete(row) { async handleDelete(row) {
console.log(row) console.log(row)
}, const confirmDelete = await Dialog.confirm('提示', { message: '是否删除此日志?' })
handleBlur(event) { if (!confirmDelete) return
this.setCurrent()
event.target && event.target.classList && event.target.classList.remove('write') const res = await this.getData()
if (res) {
Toast.success('操作成功')
this.getData()
}
}, },
// handleBlur(event) { // handleBlur(event) {
// console.log(event.target, event.target.classList)
// if (this.selectBlur && this.inputBlur) {
// this.setCurrent() // this.setCurrent()
// event.path.map(item => { // event.target && event.target.classList && event.target.classList.remove('write')
// if (item.classList && Array.from(item.classList).includes('cell')) {
// item.getElementsByClassName('el-select')[0].classList.add('none-display')
// item.getElementsByTagName('input')[0].classList.remove('write')
// item.getElementsByTagName('input')[1].classList.remove('write')
// }
// })
// }
// }, // },
cellClick(row, column, cell, event) { handleBlur(event) {
if (cell.getElementsByTagName('input')[0]) { event.path.map(item => {
cell.getElementsByTagName('input')[0].classList.add('write') if (item.classList && Array.from(item.classList).includes('cell')) {
cell.getElementsByTagName('input')[0].focus() this.agoCell = item
} }
})
},
clearCell(cell) {
if (!cell) return
this.setCurrent()
const select = cell.getElementsByClassName('el-select')
const input = cell.getElementsByTagName('input')
select && select[0] && select[0].classList.add('none-display')
input && input[0] && input[0].classList.remove('write')
input && input[1] && input[1].classList.remove('write')
}, },
// cellClick(row, column, cell, event) { // cellClick(row, column, cell, event) {
// cell.getElementsByClassName('el-select')[0].classList.remove('none-display') // if (cell.getElementsByTagName('input')[0]) {
// if (cell.getElementsByTagName('input')[0] && cell.getElementsByTagName('input')[1]) {
// cell.getElementsByTagName('input')[0].classList.add('write') // cell.getElementsByTagName('input')[0].classList.add('write')
// cell.getElementsByTagName('input')[1].classList.add('write') // cell.getElementsByTagName('input')[0].focus()
// cell.getElementsByTagName('input')[1].focus()
// } // }
// }, // },
cellClick(row, column, cell, event) {
if (column.label === '序号' || column.label === '操作') return
if (this.agoCell !== cell) {
this.clearCell(this.agoCell)
}
cell.getElementsByClassName('el-select')[0].classList.remove('none-display')
if (cell.getElementsByTagName('input')[0] && cell.getElementsByTagName('input')[1]) {
cell.getElementsByTagName('input')[0].classList.add('write')
cell.getElementsByTagName('input')[1].classList.add('write')
cell.getElementsByTagName('input')[1].focus()
}
},
rowClick(row, column, event) { rowClick(row, column, event) {
if (column.label === '序号' || column.label === '操作') return
this.setCurrent(row) this.setCurrent(row)
}, },
setCurrent(row) { setCurrent(row) {
this.$refs.singleTable.setCurrentRow(row) this.$refs.singleTable.setCurrentRow(row)
}, },
handleCurrentChange(val) {
this.currentRow = val
},
handleSizeChange() {}, handleSizeChange() {},
handlePageChange() {} handlePageChange() {}
} }
...@@ -198,8 +235,17 @@ export default { ...@@ -198,8 +235,17 @@ export default {
<style lang="sass" scoped> <style lang="sass" scoped>
.page-content .page-content
position: relative
.list-content
height: calc(100% - 120px)!important
.column-box .column-box
position: relative position: relative
::v-deep input
&::placeholder
font-size: 14px
font-family: PingFangSC-Regular, PingFang SC
font-weight: 400
color:#999999
::v-deep.el-select ::v-deep.el-select
position: absolute position: absolute
width: 10px width: 10px
...@@ -261,6 +307,7 @@ export default { ...@@ -261,6 +307,7 @@ export default {
.delete-btn .delete-btn
margin-left: 12px margin-left: 12px
color: #F56C6C color: #F56C6C
cursor: pointer
.content-header .content-header
display: flex display: flex
flex-direction: row flex-direction: row
...@@ -331,4 +378,14 @@ export default { ...@@ -331,4 +378,14 @@ export default {
color: #C0C4CC color: #C0C4CC
.none-display .none-display
display: none display: none
.buttons
position: absolute
bottom: 0
right: 0
height: 60px
line-height: 60px
border-top: 1px solid #ddd
width: 100%
padding: 0 20px
text-align: right
</style> </style>
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
total: total, total: total,
}"> }">
<div slot="operate" slot-scope="row"> <div slot="operate" slot-scope="row">
<span class="operate" v-if="row.number" @click="$router.push({ path: '/data/edit' })">编辑</span> <span class="operate" @click="$router.push({ path: '/data/edit' })">编辑</span>
<span class="operate operate-delete" v-if="row.number">删除</span> <span class="operate operate-delete" @click="handleDelete(row)">删除</span>
</div> </div>
</st-table> </st-table>
</div> </div>
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
</template> </template>
<script> <script>
import Dialog from '@/helpers/dialog'
export default { export default {
data() { data() {
return { return {
...@@ -69,6 +70,17 @@ export default { ...@@ -69,6 +70,17 @@ export default {
// this.getData() // this.getData()
}, },
methods: { methods: {
async handleDelete(row) {
console.log(row)
const confirmDelete = await Dialog.confirm('提示', { message: '是否删除此日志?' })
if (!confirmDelete) return
const res = await this.getData()
if (res) {
Toast.success('操作成功')
this.getData()
}
},
} }
} }
</script> </script>
......
...@@ -57,28 +57,38 @@ ...@@ -57,28 +57,38 @@
style="width: 100%"> style="width: 100%">
<el-table-column label="字段"> <el-table-column label="字段">
<template slot-scope="scope"> <template slot-scope="scope">
<input type="text" v-model="scope.row.field" @blur="handleBlur"> <input type="text" v-model="scope.row.field" @blur="handleBlur" placeholder="请输入">
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="类型"> <el-table-column label="类型">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.type" placeholder="请选择" @blur="handleBlur"> <pack-select v-model="scope.row.type" placeholder="请选择" @blur="handleBlur" @visible-change="handleVisibleChange" @change="handleChange(scope.row)">
<el-option <el-option
v-for="item in typeOptions" v-for="item in typeOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </pack-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="值"> <el-table-column label="值">
<template slot-scope="scope"> <template slot-scope="scope">
<input v-if="scope.row.type === 'string' || scope.row.type === 'number'" type="text" v-model="scope.row.value" @blur="handleBlur"> <input v-if="scope.row.type === 'string' || scope.row.type === 'number'" type="text" v-model="scope.row.value" @blur="handleBlur" placeholder="请输入">
<div class="btn-box" v-if="scope.row.type === 'blob'"> <div class="btn-box" v-if="scope.row.type === 'blob'">
<span class="upload-btn" v-if="!file">Select File</span> <span class="upload-btn" v-if="!scope.row.value">Select File</span>
<input type="file" @blur="handleBlur" @change="handleUpload" class="input-btn" v-if="!file"> <input type="file" @blur="handleBlur" @change="(event) => handleUpload(event, scope.row)" class="input-btn" v-if="!scope.row.value">
<span class="file-btn" v-if="file">{{file.name}}<i class="iconfont icon-guanbi" @click="deleteFile"></i></span> <span class="file-btn" v-if="scope.row.value">{{scope.row.value}}<i class="iconfont icon-guanbi" @click="deleteFile(scope.row)"></i></span>
</div>
<div v-if="scope.row.type === 'table'">
<pack-select v-model="scope.row.value" placeholder="请选择" @blur="handleBlur" @visible-change="handleVisibleChange">
<el-option
v-for="item in tableOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</pack-select>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -103,14 +113,13 @@ ...@@ -103,14 +113,13 @@
</template> </template>
<script> <script>
import Dialog from '@/helpers/dialog'
export default { export default {
data() { data() {
return { return {
form: {}, form: {},
rules: [], rules: [],
file: '', file: '',
focusFlag: false,
modelOptions: [],
typeOptions: [{ typeOptions: [{
value: 'number', value: 'number',
label: 'number' label: 'number'
...@@ -124,6 +133,14 @@ export default { ...@@ -124,6 +133,14 @@ export default {
value: 'blob', value: 'blob',
label: 'blob' label: 'blob'
}], }],
tableOptions: [{
value: 'table1',
label: 'table1'
}, {
value: 'table2',
label: 'table2'
}],
modelOptions: [],
tableData: [{ tableData: [{
field: 'name', field: 'name',
type: 'number', type: 'number',
...@@ -135,7 +152,11 @@ export default { ...@@ -135,7 +152,11 @@ export default {
}, { }, {
field: 'image', field: 'image',
type: 'blob', type: 'blob',
value: '24字节' value: ''
}, {
field: 'file',
type: 'blob',
value: ''
}, { }, {
field: 'teat', field: 'teat',
type: 'string', type: 'string',
...@@ -159,11 +180,13 @@ export default { ...@@ -159,11 +180,13 @@ export default {
methods: { methods: {
cancel() {}, cancel() {},
save() {}, save() {},
handleUpload(event) { handleUpload(event, row) {
this.file = event.target.files[0] row.file = event.target.files[0]
row.value = event.target.files[0].name
}, },
deleteFile() { deleteFile(row) {
this.file = '' row.file = ''
row.value = ''
}, },
setFlexHeight() { setFlexHeight() {
const ele = document.getElementsByClassName('flex-item') && document.getElementsByClassName('flex-item')[0] const ele = document.getElementsByClassName('flex-item') && document.getElementsByClassName('flex-item')[0]
...@@ -172,19 +195,31 @@ export default { ...@@ -172,19 +195,31 @@ export default {
addTableData() { addTableData() {
this.tableData.push({ field: '', type: 'string', value: '' }) this.tableData.push({ field: '', type: 'string', value: '' })
}, },
handleFocus() { async handleDelete(row) {
// console.log(111)
this.$emit('cell-click')
},
handleDelete(row) {
console.log(row) console.log(row)
const confirmDelete = await Dialog.confirm('提示', { message: '是否删除此日志?' })
if (!confirmDelete) return
const res = await this.getData()
if (res) {
Toast.success('操作成功')
this.getData()
}
},
handleChange(row) {
row.file = ''
row.value = ''
},
handleVisibleChange(val) {
if (!val) {
this.setCurrent()
}
}, },
handleBlur(event) { handleBlur(event) {
this.setCurrent() this.setCurrent()
event.target.classList.remove('write') event.target && event.target.classList && event.target.classList.remove('write')
}, },
cellClick(row, column, cell, event) { cellClick(row, column, cell, event) {
// console.log(cell)
if (cell.getElementsByTagName('input')[0]) { if (cell.getElementsByTagName('input')[0]) {
cell.getElementsByTagName('input')[0].classList.add('write') cell.getElementsByTagName('input')[0].classList.add('write')
cell.getElementsByTagName('input')[0].focus() cell.getElementsByTagName('input')[0].focus()
...@@ -207,9 +242,15 @@ export default { ...@@ -207,9 +242,15 @@ export default {
.page-content .page-content
text-align: left text-align: left
position: relative position: relative
::v-deep.el-form-item ::v-deep input
// height: 32px &::placeholder
// line-height: 32px font-size: 14px
font-family: PingFangSC-Regular, PingFang SC
font-weight: 400
color:#999999
::v-deep.el-form-item, ::v-deep.el-form-item__label, ::v-deep.el-form-item__content
height: 32px
line-height: 32px
margin-bottom: 24px margin-bottom: 24px
::v-deep.el-form-item.textarea ::v-deep.el-form-item.textarea
height: 100px height: 100px
...@@ -266,10 +307,11 @@ export default { ...@@ -266,10 +307,11 @@ export default {
height: calc(100% - 60px) height: calc(100% - 60px)
overflow: hidden overflow: hidden
.flex-item .flex-item
height: calc(100% - 380px) height: calc(100% - 370px)
.delete-btn .delete-btn
margin-left: 12px margin-left: 12px
color: #F56C6C color: #F56C6C
cursor: pointer
.add-btn .add-btn
height: 32px height: 32px
line-height: 28px line-height: 28px
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
style="width: 100%"> style="width: 100%">
<el-table-column label="字段"> <el-table-column label="字段">
<template slot-scope="scope"> <template slot-scope="scope">
<input type="text" v-model="scope.row.field" @blur="handleBlur"> <input type="text" v-model="scope.row.field" @blur="handleBlur" placeholder="请输入">
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="类型"> <el-table-column label="类型">
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
</el-table-column> </el-table-column>
<el-table-column label="值"> <el-table-column label="值">
<template slot-scope="scope"> <template slot-scope="scope">
<input v-if="scope.row.type === 'string' || scope.row.type === 'number'" type="text" v-model="scope.row.value" @blur="handleBlur"> <input v-if="scope.row.type === 'string' || scope.row.type === 'number'" type="text" v-model="scope.row.value" @blur="handleBlur" placeholder="请输入">
<div class="btn-box" v-if="scope.row.type === 'blob'"> <div class="btn-box" v-if="scope.row.type === 'blob'">
<span class="upload-btn" v-if="!scope.row.value">Select File</span> <span class="upload-btn" v-if="!scope.row.value">Select File</span>
<input type="file" @blur="handleBlur" @change="(event) => handleUpload(event, scope.row)" class="input-btn" v-if="!scope.row.value"> <input type="file" @blur="handleBlur" @change="(event) => handleUpload(event, scope.row)" class="input-btn" v-if="!scope.row.value">
...@@ -113,6 +113,7 @@ ...@@ -113,6 +113,7 @@
</template> </template>
<script> <script>
import Dialog from '@/helpers/dialog'
export default { export default {
data() { data() {
return { return {
...@@ -194,8 +195,16 @@ export default { ...@@ -194,8 +195,16 @@ export default {
addTableData() { addTableData() {
this.tableData.push({ field: '', type: 'string', value: '' }) this.tableData.push({ field: '', type: 'string', value: '' })
}, },
handleDelete(row) { async handleDelete(row) {
console.log(row) console.log(row)
const confirmDelete = await Dialog.confirm('提示', { message: '是否删除此日志?' })
if (!confirmDelete) return
const res = await this.getData()
if (res) {
Toast.success('操作成功')
this.getData()
}
}, },
handleChange(row) { handleChange(row) {
row.file = '' row.file = ''
...@@ -233,6 +242,12 @@ export default { ...@@ -233,6 +242,12 @@ export default {
.page-content .page-content
text-align: left text-align: left
position: relative position: relative
::v-deep input
&::placeholder
font-size: 14px
font-family: PingFangSC-Regular, PingFang SC
font-weight: 400
color:#999999
::v-deep.el-form-item, ::v-deep.el-form-item__label, ::v-deep.el-form-item__content ::v-deep.el-form-item, ::v-deep.el-form-item__label, ::v-deep.el-form-item__content
height: 32px height: 32px
line-height: 32px line-height: 32px
...@@ -296,6 +311,7 @@ export default { ...@@ -296,6 +311,7 @@ export default {
.delete-btn .delete-btn
margin-left: 12px margin-left: 12px
color: #F56C6C color: #F56C6C
cursor: pointer
.add-btn .add-btn
height: 32px height: 32px
line-height: 28px line-height: 28px
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<div slot="operate" slot-scope="row"> <div slot="operate" slot-scope="row">
<span class="operate" @click="$router.push({ path: '/params/detail' })">详情</span> <span class="operate" @click="$router.push({ path: '/params/detail' })">详情</span>
<span class="operate" @click="$router.push({ path: '/params/edit' })">编辑</span> <span class="operate" @click="$router.push({ path: '/params/edit' })">编辑</span>
<span class="operate operate-delete" @click="removeModel(row)">删除</span> <span class="operate operate-delete" @click="handleDelete(row)">删除</span>
</div> </div>
</st-table> </st-table>
</div> </div>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<div slot="operate" slot-scope="row"> <div slot="operate" slot-scope="row">
<span class="operate" @click="$router.push({ path: '/params/detail' })">详情</span> <span class="operate" @click="$router.push({ path: '/params/detail' })">详情</span>
<span class="operate" @click="$router.push({ path: '/params/edit' })">编辑</span> <span class="operate" @click="$router.push({ path: '/params/edit' })">编辑</span>
<span class="operate operate-delete" @click="removeModel(row)">删除</span> <span class="operate operate-delete" @click="handleDelete(row)">删除</span>
</div> </div>
</st-table> </st-table>
</div> </div>
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
</template> </template>
<script> <script>
import Dialog from '@/helpers/dialog'
export default { export default {
data() { data() {
return { return {
...@@ -108,7 +109,16 @@ export default { ...@@ -108,7 +109,16 @@ export default {
// this.getData() // this.getData()
}, },
methods: { methods: {
removeModel(row) { async handleDelete(row) {
console.log(row)
const confirmDelete = await Dialog.confirm('提示', { message: '是否删除此日志?' })
if (!confirmDelete) return
const res = await this.getData()
if (res) {
Toast.success('操作成功')
this.getData()
}
}, },
handleClickRow(row, column, event) { handleClickRow(row, column, event) {
console.log(row) console.log(row)
......
...@@ -40,12 +40,13 @@ module.exports = { ...@@ -40,12 +40,13 @@ module.exports = {
happyPackMode: false happyPackMode: false
}) })
.end() .end()
.end()
config.module config.module
.rule('thejs') .rule('thejs')
.test(/\.js$/) .test(/\.js$/)
.include .include
.add(path.resolve('src')) .add(resolve('src'))
.add(path.resolve('node_modules/element-ui/packages')) .add(resolve('node_modules/element-ui/packages'))
.end() .end()
.use('babel-loader') .use('babel-loader')
.loader('babel-loader') .loader('babel-loader')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!