#------------------------------------------------------------------------------------
#2022-03-03 python 中去掉数组重复记录:
global list
billlist =list(set(vlist)) #去掉重复记录;
#------------------------------------------------------------------------------------
#1、python- Flask中 数据 or_数据查询 2022-02-17
from sqlalchemy import or_
roles = F0005.query.filter(or_(F0005.var1==role,F0005.role_name==role)).all()
#------------------------------------------------------------------------------------
#2、vue中 json对象复制 2022-02-17
this.role = Object.assign({}, defaultRole)
'''以下也是对象复制'''
import { deepClone } from '@/utils'
this.role = deepClone(scope.row)
#------------------------------------------------------------------------------------
'''如何编写VUE标签过滤'''
filters: {
statusFilter(status) {
const statusMap = {
'已有': 'success',
'未有': 'danger',
}
return statusMap[status]
}
},
'''应用'''
<el-table-column align="center" label="已选" width="100">
<template slot-scope="scope">
<el-tag :type="scope.row.status | statusFilter">
{{ scope.row.status }}
</el-tag>
</template>
</el-table-column>
#--------------------------------------------------------------------------------------
'''vue--watch监听'''
watch: {
'formdata.isadmin': {
handler(newValue, oldValue) {
this.isadmin = newValue
console.log('watch...',newValue,oldValue)
},
immediate: true
}
},