Files
ZERO_CODE/ZeroCodeProject/project_template/permissions/permissions.js
vermouth789 fe39320977 123
123
2026-01-11 00:11:34 +08:00

71 lines
1.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import {ZeroCodeAxios} from "@/request/request.js";
const components = {}
const data = function () {
return {
tableData: [],
dialogVisible: false,
dialogVisible1: false,
form: {},
selections: [],
ids: [],
}
}
function mounted() {
// 解构数据
const {url, method, data: originalData, then} = axios_config.mounted.axios;
const data = JSON.parse(JSON.stringify(originalData));
let new_data = this.get_config_data(data)
new_data["submit_data"]["data"]["user_token"] = sessionStorage.getItem("user")
// 发起请求
ZeroCodeAxios({
method,
url,
data: new_data,
}).then(res => {
// 执行回调函数then回调
eval(then)
})
}
const methods = {
handleClick(row) {
this.form = row
},
select_group(val) {
this.now_select_permission = val
},
handleSelectionChange(selection) {
this.ids = selection.map(item => item.uuid);
},
handleSelection(val) {
this.selections = val
},
tableRowClassName(row) {
var arr = this.ids;
for (let i = 0; i < arr.length; i++) {
if (row.row.uuid === arr[i]) {
return 'rowStyle'
}
}
},
cellStyle(cell) {
if (cell.columnIndex == 0 || cell.columnIndex == 1) {
var arr = this.ids;
for (let i = 0; i < arr.length; i++) {
if (cell.row.uuid === arr[i]) {
return 'cell_new'
}
}
}
},
}
export default {
data: data,
methods: methods,
mounted: mounted,
components: components,
}