|
@@ -15,7 +15,7 @@
|
|
|
>
|
|
|
<div class="app-containers">
|
|
|
<DataTable
|
|
|
- :tableHeader="state.list"
|
|
|
+ :tableHeader="tableCols"
|
|
|
:tableData="tableData"
|
|
|
:tableBtnGroup="tableBtnGroup"
|
|
|
:tableProperty="{ rowKey: 'ID' }"
|
|
@@ -29,22 +29,24 @@
|
|
|
:msgTitle="msgTitle"
|
|
|
@resetForm="resetForm"
|
|
|
@delRest="delRest"
|
|
|
+ @submitForm="submitForm"
|
|
|
+ @delRemove="delRemove"
|
|
|
>
|
|
|
<div class="diacont">
|
|
|
<el-form :model="tableForm">
|
|
|
<el-row :gutter="24">
|
|
|
- <el-col :span="12">
|
|
|
+ <!-- <el-col :span="12">
|
|
|
<el-form-item label="策略名称" size="default">
|
|
|
<el-input
|
|
|
v-model="tableForm.name"
|
|
|
placeholder="请输入策略名称"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="航司二字码" size="default">
|
|
|
<el-input
|
|
|
- v-model="tableForm.china"
|
|
|
+ v-model="tableForm.IATACode"
|
|
|
placeholder="请输入航司二字码"
|
|
|
/>
|
|
|
</el-form-item>
|
|
@@ -53,7 +55,7 @@
|
|
|
<el-form-item label="起飞机场" size="default">
|
|
|
<el-select
|
|
|
style="width: 100%"
|
|
|
- v-model="tableForm.englin"
|
|
|
+ v-model="tableForm.departmentAirport"
|
|
|
class="input-shadow"
|
|
|
filterable
|
|
|
default-first-option
|
|
@@ -74,7 +76,7 @@
|
|
|
<el-form-item label="降落机场" size="default">
|
|
|
<el-select
|
|
|
style="width: 100%"
|
|
|
- v-model="tableForm.two"
|
|
|
+ v-model="tableForm.landingAirport"
|
|
|
class="input-shadow"
|
|
|
filterable
|
|
|
default-first-option
|
|
@@ -94,23 +96,38 @@
|
|
|
<el-col>
|
|
|
<el-form-item label="航班号" size="default">
|
|
|
<el-input
|
|
|
- v-model="tableForm.three"
|
|
|
+ v-model="tableForm.flightNo"
|
|
|
placeholder="请输入航班号"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col>
|
|
|
- <el-form-item label="起止时间" size="default">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="生效时间" size="default">
|
|
|
<el-date-picker
|
|
|
- v-model="tableForm.time"
|
|
|
- type="daterange"
|
|
|
- range-separator="-"
|
|
|
- start-placeholder="开始时间"
|
|
|
- end-placeholder="结束时间"
|
|
|
- />
|
|
|
+ v-model="tableForm.startDate"
|
|
|
+ :rows="1"
|
|
|
+ type="datetime"
|
|
|
+ format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ placeholder="选择日期时间"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="失效时间" size="default">
|
|
|
+ <el-date-picker
|
|
|
+ format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ v-model="tableForm.endDate"
|
|
|
+ :rows="1"
|
|
|
+ type="datetime"
|
|
|
+ placeholder="选择日期时间"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <!-- <el-col>
|
|
|
<el-form-item label="备注" size="default">
|
|
|
<el-input
|
|
|
type="textarea"
|
|
@@ -118,7 +135,7 @@
|
|
|
placeholder="请输入备注"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -130,6 +147,15 @@
|
|
|
import DataTable from "@/components/tableTemp/index.vue";
|
|
|
import Minheader from "@/components/minheader/index.vue";
|
|
|
import Dialog from "@/components/dialog/index.vue";
|
|
|
+import { Query, GeneralDataReception } from "@/api/webApi";
|
|
|
+import { ElMessage } from "element-plus";
|
|
|
+const page = ref<number>(0); //分页参数
|
|
|
+const dataContent = ref<object>({});
|
|
|
+const noMore = ref<Boolean>(false);
|
|
|
+const rowTitle = ref<String>("");
|
|
|
+const tableCols = ref([]); //表头数据
|
|
|
+const serviceId = ref<String>("");
|
|
|
+const tableObj = ref({}); //增删改数据缓存
|
|
|
const router = useRouter();
|
|
|
const flag = ref<Boolean>(false); //弹窗开关
|
|
|
const type = ref<String>(""); //判断是否删除
|
|
@@ -137,41 +163,16 @@ const msgTitle = ref<String>("新增告警预警维护"); //弹窗标题
|
|
|
const tableColsCopys = reactive<Object>({}); //弹窗\
|
|
|
const tableOptionser = ref<Array>([]); //弹窗下拉
|
|
|
const tableForm = reactive({
|
|
|
- name: "",
|
|
|
- china: "",
|
|
|
- englin: "",
|
|
|
- two: "",
|
|
|
- three: "",
|
|
|
- text: "",
|
|
|
- time: "",
|
|
|
+ IATACode: "",
|
|
|
+ departmentAirport: "",
|
|
|
+ landingAirport: "",
|
|
|
+ flightNo: "",
|
|
|
+ startDate: "",
|
|
|
+ endDate: "",
|
|
|
+ event: "",
|
|
|
}); //弹窗内容
|
|
|
//列表
|
|
|
-const tableData = ref([
|
|
|
- {
|
|
|
- name: "中国国际航空",
|
|
|
- china: "国航",
|
|
|
- englin: "AIRCHINA",
|
|
|
- two: "CA",
|
|
|
- three: "CCA",
|
|
|
- text: "CA国航",
|
|
|
- },
|
|
|
- {
|
|
|
- name: "中国国际航空",
|
|
|
- china: "国航",
|
|
|
- englin: "AIRCHINA",
|
|
|
- two: "CA",
|
|
|
- three: "CCA",
|
|
|
- text: "CA国航",
|
|
|
- },
|
|
|
- {
|
|
|
- name: "中国国际航空",
|
|
|
- china: "国航",
|
|
|
- englin: "AIRCHINA",
|
|
|
- two: "CA",
|
|
|
- three: "CCA",
|
|
|
- text: "CA国航",
|
|
|
- },
|
|
|
-]);
|
|
|
+const tableData = ref([]);
|
|
|
//表头
|
|
|
const state = reactive({
|
|
|
list: [
|
|
@@ -196,11 +197,24 @@ const tableBtnGroup = ref([
|
|
|
param: 3,
|
|
|
},
|
|
|
]);
|
|
|
+//获取弹框-下拉数据
|
|
|
+const getSelectData = async (id, name) => {
|
|
|
+ const { code, returnData } = await Query({
|
|
|
+ id,
|
|
|
+ dataContent: name ? [name] : name === null ? [null] : [],
|
|
|
+ });
|
|
|
+ if (code == 0) {
|
|
|
+ tableOptionser.value = returnData.listValues;
|
|
|
+ } else {
|
|
|
+ tableOptionser.value = [];
|
|
|
+ }
|
|
|
+};
|
|
|
//新增
|
|
|
const addForm = () => {
|
|
|
msgTitle.value = "新增告警预警维护";
|
|
|
flag.value = true;
|
|
|
type.value = "";
|
|
|
+ tableForm.event = 1;
|
|
|
};
|
|
|
//取消
|
|
|
const resetForm = () => {
|
|
@@ -241,10 +255,97 @@ const eleDialog = () => {
|
|
|
flag.value = true;
|
|
|
type.value = "del";
|
|
|
};
|
|
|
+const delRemove = () => {
|
|
|
+ tableForm.event = 3;
|
|
|
+ generalDataReception(tableForm);
|
|
|
+};
|
|
|
//删除
|
|
|
const delRest = () => {
|
|
|
flag.value = false;
|
|
|
};
|
|
|
+//获取表格数据
|
|
|
+const getQuery = async () => {
|
|
|
+ try {
|
|
|
+ const { code, returnData } = await Query({
|
|
|
+ id: DATACONTENT_ID.sysServiceWarningId,
|
|
|
+ needPage: ++page.value,
|
|
|
+ dataContent: Object.values(dataContent.value),
|
|
|
+ });
|
|
|
+ if (code === "0") {
|
|
|
+ if (returnData.listValues.length === 0) {
|
|
|
+ page.value--;
|
|
|
+ noMore.value = true;
|
|
|
+ }
|
|
|
+ const titleColumn = returnData.columnSet.find(
|
|
|
+ (item) => item.needShow === 1
|
|
|
+ );
|
|
|
+ if (titleColumn) {
|
|
|
+ rowTitle.value = titleColumn.columnName;
|
|
|
+ }
|
|
|
+ tableData.value.push(...returnData.listValues);
|
|
|
+ tableCols.value = returnData.columnSet;
|
|
|
+ returnData.columnSet.forEach((item) => {
|
|
|
+ if (item.listqueryTemplateID && item.columnName === "landingAirport") {
|
|
|
+ getSelectData(item.listqueryTemplateID);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ tableCols.value.forEach((element) => {
|
|
|
+ element.label = element.columnLabel;
|
|
|
+ element.key = element.columnName;
|
|
|
+ });
|
|
|
+ serviceId.value = returnData.submitID;
|
|
|
+ } else {
|
|
|
+ page.value--;
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ page.value--;
|
|
|
+ }
|
|
|
+};
|
|
|
+//确认提交
|
|
|
+const submitForm = () => {
|
|
|
+ generalDataReception(tableForm);
|
|
|
+};
|
|
|
+const resetTable = () => {
|
|
|
+ page.value = 0;
|
|
|
+ noMore.value = false;
|
|
|
+ tableData.value = [];
|
|
|
+};
|
|
|
+//新增-编辑-删除
|
|
|
+const generalDataReception = async (data) => {
|
|
|
+ try {
|
|
|
+ data = {
|
|
|
+ ...data,
|
|
|
+ };
|
|
|
+ const { code } = await GeneralDataReception({
|
|
|
+ serviceId: serviceId.value,
|
|
|
+ dataContent: JSON.stringify(data),
|
|
|
+ });
|
|
|
+ if (code == 0) {
|
|
|
+ ElMessage.success(`操作成功`);
|
|
|
+ // this.$message.success("操作成功");
|
|
|
+ resetTable();
|
|
|
+ getQuery();
|
|
|
+ resetForm();
|
|
|
+ flag.value = false;
|
|
|
+ // rmFlag.value = false;
|
|
|
+ tableObj.value = {};
|
|
|
+ // this.$router.go(0);
|
|
|
+ } else {
|
|
|
+ ElMessage.error(`操作失败`);
|
|
|
+ // this.$message.error("操作失败");
|
|
|
+ // this.flag = false;
|
|
|
+ // this.rmFlag = false;
|
|
|
+ tableObj.value = {};
|
|
|
+ resetForm();
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ flag.value = false;
|
|
|
+ // rmFlag.value = false;
|
|
|
+ tableObj.value = {};
|
|
|
+ resetForm();
|
|
|
+ }
|
|
|
+};
|
|
|
+getQuery();
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
::v-deep .el-form-item__label {
|