|
|
|
@ -44,7 +44,6 @@
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<pagination
|
|
|
|
|
v-show="total>0"
|
|
|
|
|
:total="total"
|
|
|
|
@ -54,6 +53,94 @@
|
|
|
|
|
></pagination>
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
<el-card>
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="systemLoading" :data="systemList" style="width: 100%" border>
|
|
|
|
|
<el-table-column type="index" label="序号" width="50"></el-table-column>
|
|
|
|
|
<el-table-column label="标题" prop="paramName" width="320"></el-table-column>
|
|
|
|
|
<!-- <el-table-column label="参数键" prop="paramKey" width="200"></el-table-column>-->
|
|
|
|
|
<el-table-column label="参数名称" prop="paramValue" width="100"></el-table-column>
|
|
|
|
|
<el-table-column label="描述" :show-overflow-tooltip="true">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ scope.row.paramExplain }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="操作" width="100">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
type="text"
|
|
|
|
|
size="small"
|
|
|
|
|
@click.native="handleForm(scope.$index, scope.row)"
|
|
|
|
|
>设置
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<!--表单-->
|
|
|
|
|
<el-dialog
|
|
|
|
|
:title="formMap[formName]"
|
|
|
|
|
:visible.sync="formVisible"
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
:close-on-press-escape="false"
|
|
|
|
|
:before-close="hideForm"
|
|
|
|
|
width="45%"
|
|
|
|
|
top="5vh"
|
|
|
|
|
>
|
|
|
|
|
<el-form :model="formData" :rules="formRules" ref="dataForm">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-form-item label="标题:" prop="paramName" label-width="100px">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.paramName"
|
|
|
|
|
auto-complete="off"
|
|
|
|
|
:disabled="true"
|
|
|
|
|
style="width: 90%"
|
|
|
|
|
></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-form-item label="参数键:" prop="paramKey" label-width="100px">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.paramKey"
|
|
|
|
|
auto-complete="off" style="width: 90%"
|
|
|
|
|
:disabled="true"
|
|
|
|
|
></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-form-item label="参数名称" prop="paramValue" label-width="100px">
|
|
|
|
|
<el-input type="" v-model="formData.paramValue" auto-complete="off" style="width: 90%"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-form-item label="描述:" label-width="100px">
|
|
|
|
|
<el-input
|
|
|
|
|
type="textarea"
|
|
|
|
|
v-model="formData.paramExplain" style="width: 90%"
|
|
|
|
|
:disabled="true"
|
|
|
|
|
></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<!--<el-form-item label="参数状态" prop="paramStatus">-->
|
|
|
|
|
<!--<el-radio-group v-model="formData.paramStatus">-->
|
|
|
|
|
<!--<el-radio :label="0">禁用</el-radio>-->
|
|
|
|
|
<!--<el-radio :label="1">正常</el-radio>-->
|
|
|
|
|
<!--</el-radio-group>-->
|
|
|
|
|
<!--</el-form-item>-->
|
|
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click.native="hideForm">取消</el-button>
|
|
|
|
|
<el-button type="primary" @click.native="formSubmit()" :loading="formLoading"
|
|
|
|
|
>提交
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
@ -62,6 +149,18 @@ import {
|
|
|
|
|
filterList,
|
|
|
|
|
modifySetup
|
|
|
|
|
} from "@/api/param/basicProductConfig";
|
|
|
|
|
import { systemParamConfigList, systemParamConfigSave } from '@/api/system/param/systemParamConfig'
|
|
|
|
|
|
|
|
|
|
const formJson = {
|
|
|
|
|
id: "",
|
|
|
|
|
parentId: "",
|
|
|
|
|
paramName: "",
|
|
|
|
|
paramKey: "",
|
|
|
|
|
paramValue: "",
|
|
|
|
|
paramStatus: 1,
|
|
|
|
|
paramType: 1,
|
|
|
|
|
paramExplain: "",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
@ -70,13 +169,37 @@ export default {
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 20
|
|
|
|
|
},
|
|
|
|
|
systemQuery: {
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 20,
|
|
|
|
|
paramType:2,
|
|
|
|
|
paramStatus: 1,
|
|
|
|
|
},
|
|
|
|
|
formRules: {
|
|
|
|
|
paramValue: [{required: true, message: "请输入参数值", trigger: "blur"}],
|
|
|
|
|
// ,
|
|
|
|
|
// paramStatus: [
|
|
|
|
|
// {required: true, message: "请选择参数状态", trigger: "change"}
|
|
|
|
|
// ]
|
|
|
|
|
},
|
|
|
|
|
list: [],
|
|
|
|
|
formLoading: false,
|
|
|
|
|
systemList:[],
|
|
|
|
|
total: 0,
|
|
|
|
|
formData: formJson,
|
|
|
|
|
formName: null,
|
|
|
|
|
systemTotal: 0,
|
|
|
|
|
loading: true,
|
|
|
|
|
systemLoading:true,
|
|
|
|
|
formVisible: false,
|
|
|
|
|
enableMap: {
|
|
|
|
|
true: "是",
|
|
|
|
|
false: "否",
|
|
|
|
|
},
|
|
|
|
|
formMap: {
|
|
|
|
|
add: "新增运行参数",
|
|
|
|
|
update: "运行参数设置",
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
@ -111,6 +234,76 @@ export default {
|
|
|
|
|
this.total = 0;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 显示表单
|
|
|
|
|
handleForm(index, row) {
|
|
|
|
|
this.formVisible = true;
|
|
|
|
|
this.formData = JSON.parse(JSON.stringify(formJson));
|
|
|
|
|
if (row !== null) {
|
|
|
|
|
this.formData = Object.assign({}, row);
|
|
|
|
|
}
|
|
|
|
|
this.formName = "add";
|
|
|
|
|
if (index !== null) {
|
|
|
|
|
this.index = index;
|
|
|
|
|
this.formName = "update";
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
hideForm() {
|
|
|
|
|
// 更改值
|
|
|
|
|
this.formVisible = !this.formVisible;
|
|
|
|
|
return true;
|
|
|
|
|
},
|
|
|
|
|
getSystemList() {
|
|
|
|
|
this.systemLoading = true;
|
|
|
|
|
systemParamConfigList(this.systemQuery)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
this.systemLoading = false;
|
|
|
|
|
this.systemList = response.data.list || [];
|
|
|
|
|
this.systemTotal = response.data.total || 0;
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.systemLoading = false;
|
|
|
|
|
this.systemList = [];
|
|
|
|
|
this.systemTotal = 0;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
formSubmit() {
|
|
|
|
|
// if (!Number.isInteger(parseInt(this.formData.paramValue))) {
|
|
|
|
|
// this.$message.warning("参数值必须为数字");
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
this.$refs["dataForm"].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.formLoading = true;
|
|
|
|
|
let data = Object.assign({}, this.formData);
|
|
|
|
|
data.paramValue = data.paramValue.trim();
|
|
|
|
|
systemParamConfigSave(data, this.formName)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
this.formLoading = false;
|
|
|
|
|
if (response.code != 20000) {
|
|
|
|
|
this.$message.error(response.message);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
this.$message.success("操作成功");
|
|
|
|
|
this.formVisible = false;
|
|
|
|
|
if (this.formName === "add") {
|
|
|
|
|
// 向头部添加数据
|
|
|
|
|
if (response.data && response.data.id) {
|
|
|
|
|
data.id = response.data.id;
|
|
|
|
|
this.list.unshift(data);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.list.splice(this.index, 1, data);
|
|
|
|
|
}
|
|
|
|
|
// 刷新表单
|
|
|
|
|
this.resetForm();
|
|
|
|
|
this.getSystemList();
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.formLoading = false;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleSave(index, row) {
|
|
|
|
|
this.currentCheckIndex = -1;
|
|
|
|
|
modifySetup(row).then((res) => {
|
|
|
|
@ -129,6 +322,7 @@ export default {
|
|
|
|
|
created() {
|
|
|
|
|
// 加载表格数据
|
|
|
|
|
this.getList();
|
|
|
|
|
this.getSystemList();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|