71 lines
1.7 KiB
JavaScript
71 lines
1.7 KiB
JavaScript
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,
|
||
} |