修补iconPicker -> icon 导致的bug
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title> Pear Admin Flask </title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='admin/component/pear/css/pear.css') }}">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='admin/admin/css/load.css') }}"/>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='admin/admin/css/loader.css') }}"/>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='admin/admin/css/admin.css') }}"/>
|
||||
<!-- 主 题 更 换 -->
|
||||
<style id="pearadmin-bg-color"></style>
|
||||
|
||||
@@ -85,20 +85,20 @@
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery', 'iconPicker', 'dtree'], function () {
|
||||
layui.use(['form', 'jquery', 'icon', 'dtree'], function () {
|
||||
let form = layui.form
|
||||
let $ = layui.jquery
|
||||
let iconPicker = layui.iconPicker
|
||||
let icon = layui.icon
|
||||
let dtree = layui.dtree
|
||||
|
||||
dtree.renderSelect({
|
||||
elem: '#selectParent',
|
||||
url: '/admin/power/selectParent',
|
||||
method: 'get',
|
||||
selectInputName: { nodeId: 'parentId', context: 'powerName' },
|
||||
selectInputName: {nodeId: 'parentId', context: 'powerName'},
|
||||
skin: 'layui',
|
||||
dataFormat: 'list',
|
||||
response: { treeId: 'powerId', parentId: 'parentId', title: 'powerName' }, //修改response中返回数据的定义
|
||||
response: {treeId: 'powerId', parentId: 'parentId', title: 'powerName'}, //修改response中返回数据的定义
|
||||
selectInitVal: '0'
|
||||
})
|
||||
|
||||
@@ -133,30 +133,25 @@
|
||||
type: 'post',
|
||||
success: function (result) {
|
||||
if (result.success) {
|
||||
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||
layer.msg(result.msg, {icon: 1, time: 1000}, function () {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
|
||||
parent.render()
|
||||
})
|
||||
} else {
|
||||
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||
layer.msg(result.msg, {icon: 2, time: 1000})
|
||||
}
|
||||
}
|
||||
})
|
||||
return false
|
||||
})
|
||||
|
||||
iconPicker.render({
|
||||
// 选择器,推荐使用input
|
||||
icon.render({
|
||||
elem: '#icon',
|
||||
// 数据类型:fontClass/unicode,推荐使用fontClass
|
||||
type: 'fontClass',
|
||||
// 是否开启搜索:true/false
|
||||
search: true,
|
||||
// 是否开启分页
|
||||
page: true,
|
||||
// 每页显示数量,默认12
|
||||
limit: 12,
|
||||
// 点击回调
|
||||
style: 'color: #5FB878;',
|
||||
placeholder: '',
|
||||
isSplit: true,
|
||||
page: false,
|
||||
search: false,
|
||||
click: function (data) {
|
||||
console.log(data)
|
||||
}
|
||||
|
||||
@@ -97,20 +97,20 @@
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery', 'iconPicker', 'dtree'], function () {
|
||||
layui.use(['form', 'jquery', 'icon', 'dtree'], function () {
|
||||
let form = layui.form
|
||||
let $ = layui.jquery
|
||||
let iconPicker = layui.iconPicker
|
||||
let icon = layui.icon
|
||||
let dtree = layui.dtree
|
||||
|
||||
dtree.renderSelect({
|
||||
elem: '#selectParent',
|
||||
url: '/admin/power/selectParent',
|
||||
method: 'get',
|
||||
selectInputName: { nodeId: 'parentId', context: 'powerName' },
|
||||
selectInputName: {nodeId: 'parentId', context: 'powerName'},
|
||||
skin: 'layui',
|
||||
dataFormat: 'list',
|
||||
response: { treeId: 'powerId', parentId: 'parentId', title: 'powerName' },
|
||||
response: {treeId: 'powerId', parentId: 'parentId', title: 'powerName'},
|
||||
selectInitVal: "{{ power.parent_id }}"
|
||||
})
|
||||
|
||||
@@ -145,30 +145,30 @@
|
||||
type: 'put',
|
||||
success: function (result) {
|
||||
if (result.success) {
|
||||
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||
layer.msg(result.msg, {icon: 1, time: 1000}, function () {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
|
||||
parent.render()
|
||||
})
|
||||
} else {
|
||||
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||
layer.msg(result.msg, {icon: 2, time: 1000})
|
||||
}
|
||||
}
|
||||
})
|
||||
return false
|
||||
})
|
||||
|
||||
iconPicker.render({
|
||||
icon.render({
|
||||
elem: '#icon',
|
||||
type: 'fontClass',
|
||||
search: true,
|
||||
page: true,
|
||||
limit: 12,
|
||||
style: 'color: #5FB878;',
|
||||
placeholder: '',
|
||||
isSplit: true,
|
||||
page: false,
|
||||
search: false,
|
||||
click: function (data) {
|
||||
console.log(data)
|
||||
}
|
||||
})
|
||||
|
||||
iconPicker.checkIcon('icon', "{{ icon }}")
|
||||
|
||||
window.init = function (type) {
|
||||
if (type == '0') {
|
||||
|
||||
Reference in New Issue
Block a user