refactor(javascript):移除esm,es6语法

This commit is contained in:
zhengxinonly
2021-12-08 15:43:10 +08:00
parent 820ab9f5c6
commit 3453b01938
21 changed files with 75 additions and 193 deletions
+8 -10
View File
@@ -53,9 +53,7 @@
</button>
</script>
<script type="module">
import { RIGHTS_API, parserTableData as parseData } from '/static/api/http.js'
<script>
layui.use(['table', 'form', 'jquery', 'treetable', 'popup', 'dtree', 'iconPicker'], function () {
let table = layui.table
let form = layui.form
@@ -72,11 +70,11 @@
{ field: 'icon', title: '图标', templet: (d) => `<i class="layui-icon ${d.icon}"></i>` },
{
field: 'powerType', title: '权限类型', templet: (d) => {
if (d.powerType === '0') {
if (d.powerType === 0) {
return `<span>目录</span>`
} else if (d.powerType === '1') {
} else if (d.powerType === 1) {
return `<span>菜单</span>`
} else if (d.powerType === '2') {
} else if (d.powerType === 2) {
return `<span>按钮</span>`
}
},
@@ -103,7 +101,7 @@
treeDefaultClose: true,
toolbar: '#toolbar',
elem: '#tables',
url: RIGHTS_API.RIGHTS(),
url: '/api/v1/rights/rights',
page: false,
cols: get_columns(),
})
@@ -163,7 +161,7 @@
}
let loading = layer.load()
$.ajax({
url: RIGHTS_API.POWER_STATUS(this.value),
url: '/api/v1/rights/power/' + this.value + '/status',
data: JSON.stringify({ powerId: this.value, operate: operate }),
dataType: 'json',
contentType: 'application/json',
@@ -203,7 +201,7 @@
layer.close(index)
let loading = layer.load()
$.ajax({
url: RIGHTS_API.POWER(obj.data['powerId']),
url: '/api/v1/rights/power/' + obj.data['powerId'],
dataType: 'json',
type: 'delete',
success: function (result) {
@@ -245,7 +243,7 @@
layer.close(index)
let loading = layer.load()
$.ajax({
url: RIGHTS_API.RIGHTS(),
url: '/api/v1/rights/rights',
data: { ids: ids },
dataType: 'json',
type: 'delete',