|
@@ -20,60 +20,62 @@
|
|
|
class="demo-ruleForm"
|
|
|
label-width="140px"
|
|
|
>
|
|
|
- <el-form-item label="源数据名称" prop="name">
|
|
|
+ <el-form-item label="源数据名称" prop="dataName">
|
|
|
<el-input
|
|
|
size="small"
|
|
|
maxlength="128"
|
|
|
placeholder="请输入源数据名称"
|
|
|
- v-model="ruleForm.name"
|
|
|
+ v-model="ruleForm.dataName"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="数据格式" prop="tag">
|
|
|
+ <el-form-item label="数据格式" prop="dataType">
|
|
|
<el-select
|
|
|
size="small"
|
|
|
style="width: 100%"
|
|
|
- v-model="ruleForm.tag"
|
|
|
- placeholder="请选择数据格式"
|
|
|
+ v-model="ruleForm.dataType"
|
|
|
+ placeholder="请选择数据类型"
|
|
|
>
|
|
|
- <el-option label="Mysql_local" value="1"></el-option>
|
|
|
+ <el-option label="JSON" value="1"></el-option>
|
|
|
+ <el-option label="XML" value="2"></el-option>
|
|
|
+ <el-option label=" REGULA" value="3"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="目标数据描述" prop="code">
|
|
|
+ <el-form-item label="目标数据描述">
|
|
|
<el-input
|
|
|
maxlength="128"
|
|
|
placeholder="请输入描述"
|
|
|
type="textarea"
|
|
|
:rows="1"
|
|
|
- v-model="ruleForm.code"
|
|
|
+ v-model="ruleForm.dataDescribe"
|
|
|
style="width: 575px"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
<el-row>
|
|
|
- <el-form-item label="取值方法" prop="fullName">
|
|
|
- <el-col :span="12">
|
|
|
- <el-input
|
|
|
- size="small"
|
|
|
- maxlength="128"
|
|
|
- placeholder="请输入取值方法"
|
|
|
- v-model="ruleForm.fullName"
|
|
|
- style="width: 575px"
|
|
|
- ></el-input>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="检测方法" prop="fullName">
|
|
|
- <el-col :span="12">
|
|
|
- <el-input
|
|
|
- size="small"
|
|
|
- maxlength="128"
|
|
|
- placeholder="请输入检测方法"
|
|
|
- v-model="ruleForm.fullName"
|
|
|
- style="width: 575px"
|
|
|
- ></el-input>
|
|
|
- </el-col>
|
|
|
+ <el-col :span="10.5">
|
|
|
+ <el-form-item label="取值方法">
|
|
|
+ <el-input
|
|
|
+ maxlength="128"
|
|
|
+ placeholder="请输入取值方法"
|
|
|
+ type="textarea"
|
|
|
+ :rows="1"
|
|
|
+ v-model="ruleForm.computingMethod"
|
|
|
+ style="width: 575px"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="10.5">
|
|
|
|
|
|
- </el-form-item>
|
|
|
+ <el-form-item label="检测方法">
|
|
|
+ <el-input
|
|
|
+ maxlength="128"
|
|
|
+ placeholder="请输入检测方法"
|
|
|
+ type="textarea"
|
|
|
+ :rows="1"
|
|
|
+ v-model="ruleForm.validationExpression"
|
|
|
+ style="width: 575px"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -92,49 +94,49 @@
|
|
|
<div class="table-info">
|
|
|
<el-table
|
|
|
:data="posArr"
|
|
|
- row-key="id"
|
|
|
+ row-key="ItemID"
|
|
|
:row-class-name="tabRowClassName"
|
|
|
height="56vh"
|
|
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
|
class="table"
|
|
|
style="width: 100%"
|
|
|
- :header-cell-style="{ 'text-align': 'center' }"
|
|
|
- :cell-style="{ 'text-align': 'center' }"
|
|
|
+ :header-cell-style="{ 'text-align': 'left' }"
|
|
|
+ :cell-style="{ 'text-align': 'left' }"
|
|
|
>
|
|
|
- <el-table-column prop="itemName" label="数据项名称"></el-table-column>
|
|
|
- <el-table-column prop="itemCode" label="源数据编号"></el-table-column>
|
|
|
+ <el-table-column prop="ItemName" label="数据项名称"></el-table-column>
|
|
|
+ <!-- <el-table-column prop="itemCode" label="数据项标识"></el-table-column> -->
|
|
|
<el-table-column
|
|
|
- prop="dataTypeName"
|
|
|
+ prop="dataTypeText"
|
|
|
label="数据类型"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="canNullName"
|
|
|
+ prop="ItemDescribe"
|
|
|
label="数据项描述"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="isOnlyMarkName"
|
|
|
+ prop="computingMethod"
|
|
|
label="取值方法"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="analysisDataItemName"
|
|
|
+ prop="computingExpression"
|
|
|
label="取值表达式"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="analysisDataItemName"
|
|
|
+ prop="outputIdentifier"
|
|
|
label="输出标识符"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="analysisDataItemName"
|
|
|
- label="多条拆分"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="analysisDataItemName"
|
|
|
+ prop="isMustText"
|
|
|
label="是否必填"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="analysisDataItemName"
|
|
|
+ prop="isKeyText"
|
|
|
label="是否唯一"
|
|
|
></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="isSpliteText"
|
|
|
+ label="多条拆分"
|
|
|
+ ></el-table-column>
|
|
|
<el-table-column label="操作">
|
|
|
<div
|
|
|
slot-scope="scope"
|
|
@@ -149,7 +151,7 @@
|
|
|
<el-button
|
|
|
class="fut"
|
|
|
size="small"
|
|
|
- @click="handleEdit(scope.$index, scope.row)"
|
|
|
+ @click="handleAdd(scope.$index, scope.row)"
|
|
|
>新增</el-button
|
|
|
>
|
|
|
<el-button
|
|
@@ -189,36 +191,51 @@
|
|
|
</div>
|
|
|
</Dialog>
|
|
|
<!--新增/编辑存储数据项弹框-->
|
|
|
- <Dialog width="750px" customClass="dataStoreInfoDialog" :flag="addFlag">
|
|
|
+ <Dialog width="748px" customClass="dataStoreInfoDialog" :flag="addFlag">
|
|
|
<div class="dialog-public-background">
|
|
|
<div class="flx">
|
|
|
- {{ msgType === 1 ? "新增" : "编辑" }}新增数据项信息
|
|
|
+ {{ msgType === 1 ? "新增" : "编辑" }}数据项信息
|
|
|
</div>
|
|
|
<div class="contenter">
|
|
|
<el-form
|
|
|
:model="dataForm"
|
|
|
:rules="dataRules"
|
|
|
ref="dataForm"
|
|
|
- label-width="100px"
|
|
|
+ label-width="130px"
|
|
|
class="demo-dataForm"
|
|
|
>
|
|
|
- <el-row :gutter="8">
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item class="flex1" label="所属数据项" prop="parentID">
|
|
|
+ <el-cascader
|
|
|
+ size="small"
|
|
|
+ style="width: 100%"
|
|
|
+ placeholder="请选择所属数据项"
|
|
|
+ v-model="dataForm.parentIDs"
|
|
|
+ :options="posArr"
|
|
|
+ ref="cascader"
|
|
|
+ :props="{ label: 'ItemName', value: 'ItemID',checkStrictly: true }"
|
|
|
+ @change="handleChange"
|
|
|
+ >
|
|
|
+ </el-cascader>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="数据项名称" prop="name">
|
|
|
+ <el-form-item class="flex1" label="数据项名称" prop="ItemName">
|
|
|
<el-input
|
|
|
maxlength="128"
|
|
|
size="small"
|
|
|
placeholder="请输入数据项名称"
|
|
|
- v-model="dataForm.name"
|
|
|
+ v-model="dataForm.ItemName"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="数据类型" prop="tag">
|
|
|
+ <el-form-item class="flex1" label="数据类型" prop="dataType">
|
|
|
<el-select
|
|
|
size="small"
|
|
|
style="width: 100%"
|
|
|
- v-model="dataForm.tag"
|
|
|
+ v-model="dataForm.dataType"
|
|
|
placeholder="请选择数据类型"
|
|
|
>
|
|
|
<el-option
|
|
@@ -231,83 +248,79 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- </el-row>
|
|
|
- <el-row :gutter="8">
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="取值方法" prop="tag">
|
|
|
- <el-select
|
|
|
+ <el-form-item
|
|
|
+ class="flex1"
|
|
|
+ label="输出标识符"
|
|
|
+ prop="outputIdentifier"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ maxlength="128"
|
|
|
size="small"
|
|
|
- style="width: 100%"
|
|
|
- v-model="dataForm.tag"
|
|
|
- placeholder="请选择取值方法"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in optiondata"
|
|
|
- :key="item.id"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ placeholder="请输入输出标识符"
|
|
|
+ v-model="dataForm.outputIdentifier"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="输出标识符" prop="name">
|
|
|
+ <el-form-item
|
|
|
+ class="flex1"
|
|
|
+ label="取值方法"
|
|
|
+ prop="computingMethod"
|
|
|
+ >
|
|
|
<el-input
|
|
|
maxlength="128"
|
|
|
size="small"
|
|
|
- placeholder="输出标识符"
|
|
|
- v-model="dataForm.name"
|
|
|
+ placeholder="请输入取值方法"
|
|
|
+ v-model="dataForm.computingMethod"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row :gutter="8">
|
|
|
+ <el-row :gutter="24">
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item
|
|
|
- label="取值表达式"
|
|
|
- prop="priority"
|
|
|
- >
|
|
|
+ <el-form-item label="取值表达式">
|
|
|
<el-input
|
|
|
+ v-model="dataForm.computingExpression"
|
|
|
+ size="medium"
|
|
|
type="textarea"
|
|
|
- placeholder="取值表达式"
|
|
|
- v-model="dataForm.priority"
|
|
|
- style="width: 104%"
|
|
|
- ></el-input>
|
|
|
+ :rows="2"
|
|
|
+ placeholder="请输入取值表达式"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="数据项描述">
|
|
|
<el-input
|
|
|
- v-model="dataForm.uninq"
|
|
|
- size="small"
|
|
|
- placeholder="请输入描述"
|
|
|
- style="width: 104%"
|
|
|
+ v-model="dataForm.ItemDescribe"
|
|
|
+ size="medium"
|
|
|
+ type="textarea"
|
|
|
+ :rows="2"
|
|
|
+ placeholder="请输入数据项描述"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row :gutter="8">
|
|
|
+ <el-row :gutter="24">
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item class="flexer" label="多条拆分">
|
|
|
- <el-radio v-model="dataForm.isnull" label="1">是</el-radio>
|
|
|
- <el-radio v-model="dataForm.isnull" label="0">否</el-radio>
|
|
|
+ <el-form-item class="flexer" label="允许空值">
|
|
|
+ <el-radio v-model="dataForm.isMust" label="1">是</el-radio>
|
|
|
+ <el-radio v-model="dataForm.isMust" label="0">否</el-radio>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item class="flexer" label="是否必填">
|
|
|
- <el-radio v-model="dataForm.uninq" label="1">是</el-radio>
|
|
|
- <el-radio v-model="dataForm.uninq" label="0">否</el-radio>
|
|
|
+ <el-form-item class="flexer" label="唯一项标志">
|
|
|
+ <el-radio v-model="dataForm.isKey" label="1">是</el-radio>
|
|
|
+ <el-radio v-model="dataForm.isKey" label="0">否</el-radio>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item class="flexer" label="是否唯一">
|
|
|
- <el-radio v-model="dataForm.uninq" label="1">是</el-radio>
|
|
|
- <el-radio v-model="dataForm.uninq" label="0">否</el-radio>
|
|
|
+ <el-form-item class="flexer" label="多条拆分">
|
|
|
+ <el-radio v-model="dataForm.isSplite" label="1">是</el-radio>
|
|
|
+ <el-radio v-model="dataForm.isSplite" label="0">否</el-radio>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
-
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<div class="foot center" style="padding-right: 35px">
|
|
@@ -330,15 +343,7 @@
|
|
|
<script>
|
|
|
import Search from "@/layout/components/Search/index.vue";
|
|
|
import Dialog from "@/layout/components/Dialog/index.vue";
|
|
|
-import {
|
|
|
- Datastorage,
|
|
|
- Datastoragemod,
|
|
|
- storageList,
|
|
|
- analysisList,
|
|
|
- anaListmod,
|
|
|
- storageListadd,
|
|
|
- storageListdel,
|
|
|
-} from "@/api/acquisition";
|
|
|
+import { Query, GeneralDataReception } from "@/api/dataIntegration";
|
|
|
import { translateDataToTreeAll, findarrays } from "@/utils/validate";
|
|
|
export default {
|
|
|
name: "dataStoreInfo",
|
|
@@ -347,18 +352,26 @@ export default {
|
|
|
return {
|
|
|
ruleForm: {
|
|
|
//基本信息表单
|
|
|
- name: "",
|
|
|
- fullName: "",
|
|
|
- code: "",
|
|
|
- tag: "",
|
|
|
+ tdataName: "",
|
|
|
+ eventID: "",
|
|
|
+ datatype: "",
|
|
|
+ dataDescribe: "",
|
|
|
},
|
|
|
rules: {
|
|
|
//基本信息验证
|
|
|
- name: [{ required: true, message: "请输入存储名称", trigger: "blur" }],
|
|
|
- fullName: [
|
|
|
- { required: true, message: "请输入存储标识", trigger: "blur" },
|
|
|
+ tdataName: [
|
|
|
+ { required: true, message: "请输入目标数据名", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ eventID: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请输入目标数据事件标识",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ datatype: [
|
|
|
+ { required: true, message: "请选择数据类型", trigger: "change" },
|
|
|
],
|
|
|
- tag: [{ required: true, message: "请选择存储方式", trigger: "change" }],
|
|
|
},
|
|
|
posArr: [], //存储数据项数据
|
|
|
posArrCopy: [], //临时存放数据
|
|
@@ -366,28 +379,16 @@ export default {
|
|
|
rmIndex: null, //选中的表格序号
|
|
|
flag: false, //删除弹框
|
|
|
msgType: 1, //新增or编辑
|
|
|
- dataForm: {
|
|
|
- //数据项表单
|
|
|
- id: "",
|
|
|
- name: "",
|
|
|
- demo: "",
|
|
|
- code: "",
|
|
|
- tag: "",
|
|
|
- uninq: "1",
|
|
|
- isnull: "1",
|
|
|
- form: "",
|
|
|
- datas: "",
|
|
|
- priority: "",
|
|
|
- analysisDataItemSourceId: "",
|
|
|
- },
|
|
|
+ dataForm: {},
|
|
|
dataRules: {
|
|
|
//数据项表单验证
|
|
|
- name: [{ required: true, message: "请输入存储名称", trigger: "blur" }],
|
|
|
- code: [{ required: true, message: "请输入存储标识", trigger: "blur" }],
|
|
|
- tag: [{ required: true, message: "请选择存储方式", trigger: "change" }],
|
|
|
- priority: [
|
|
|
- { required: true, message: "请选取值优先级", trigger: "change" },
|
|
|
+ ItemName: [
|
|
|
+ { required: true, message: "请输入数据项名称", trigger: "blur" },
|
|
|
],
|
|
|
+ code: [
|
|
|
+ { required: true, message: "请输入数据来源表达式", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ dataType: [{ required: true, message: "请选数据类型", trigger: "change" }],
|
|
|
},
|
|
|
addFlag: false, //数据项弹框,
|
|
|
dataStoreid: "", //修改id,
|
|
@@ -413,7 +414,6 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
sourceList: [], //取值来源
|
|
|
- sourceider: "", //取值来源id
|
|
|
tableData: [],
|
|
|
deleID: "", //删除id
|
|
|
};
|
|
@@ -421,14 +421,8 @@ export default {
|
|
|
created() {
|
|
|
const { id } = this.$route.query;
|
|
|
this.dataStoreid = id;
|
|
|
- this.AcquisitionList();
|
|
|
- this.DatastorageList();
|
|
|
this.storagedetails();
|
|
|
- },
|
|
|
- watch: {
|
|
|
- sourceider() {
|
|
|
- this.Dataitem();
|
|
|
- },
|
|
|
+ this.getDataList();
|
|
|
},
|
|
|
methods: {
|
|
|
tabRowClassName({ row, rowIndex }) {
|
|
@@ -441,91 +435,107 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- //数据采集列表-取值来源
|
|
|
- async AcquisitionList() {
|
|
|
- const result = await analysisList();
|
|
|
- if (result.code == 0) {
|
|
|
- this.sourceList = result.returnData;
|
|
|
- }
|
|
|
- },
|
|
|
//数据项信息
|
|
|
- async Dataitem() {
|
|
|
+ // async Dataitem() {
|
|
|
+ // let params = {
|
|
|
+ // sourceId: this.sourceider,
|
|
|
+ // };
|
|
|
+ // const result = await anaListmod(params);
|
|
|
+ // if (result.code == 0) {
|
|
|
+ // this.sourceList = result.returnData;
|
|
|
+ // this.tableData = result.returnData;
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ //详情查询
|
|
|
+ async storagedetails() {
|
|
|
let params = {
|
|
|
- sourceId: this.sourceider,
|
|
|
+ id: 18,
|
|
|
+ dataContent: [this.dataStoreid],
|
|
|
};
|
|
|
- const result = await anaListmod(params);
|
|
|
+ const result = await Query(params);
|
|
|
if (result.code == 0) {
|
|
|
- this.tableData = result.returnData;
|
|
|
+ result.returnData.forEach((element) => {
|
|
|
+ element.dataType = element.dataType + "";
|
|
|
+ });
|
|
|
+ this.ruleForm = result.returnData[0];
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.message ?? "失败");
|
|
|
}
|
|
|
},
|
|
|
- //详情查询
|
|
|
- async storagedetails() {
|
|
|
+
|
|
|
+ //保存
|
|
|
+ async storagemod() {
|
|
|
+ this.ruleForm["operate"] = "2";
|
|
|
+ try {
|
|
|
+ const res = await GeneralDataReception({
|
|
|
+ serviceId: "4",
|
|
|
+ dataContent: JSON.stringify(this.ruleForm),
|
|
|
+ });
|
|
|
+ if (res.code === "0") {
|
|
|
+ this.$message.success(res.message ?? "成功");
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.message ?? "失败");
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log("错误", error);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async getDataList() {
|
|
|
let params = {
|
|
|
- targetId: this.dataStoreid,
|
|
|
+ id: 16,
|
|
|
+ dataContent: [this.dataStoreid],
|
|
|
};
|
|
|
- const result = await storageList(params);
|
|
|
+ const result = await Query(params);
|
|
|
if (result.code == 0) {
|
|
|
- result.returnData.forEach((element) => {
|
|
|
- if (element.dataType == "1") {
|
|
|
- element.dataTypeName = "字符";
|
|
|
- } else if (element.dataType == "2") {
|
|
|
- element.dataTypeName = "数字";
|
|
|
- } else if (element.dataType == "3") {
|
|
|
- element.dataTypeName = "日期";
|
|
|
- } else {
|
|
|
- element.dataTypeName = "时间";
|
|
|
+ console.log(result);
|
|
|
+ result.returnData.forEach(item =>{
|
|
|
+ if(item.dataType==1){
|
|
|
+ item['dataTypeText'] = "字符串"
|
|
|
}
|
|
|
- if (element.canNull == true) {
|
|
|
- element.canNullName = "是";
|
|
|
- } else {
|
|
|
- element.canNullName = "否";
|
|
|
+ else if(item.dataType==2){
|
|
|
+ item['dataTypeText'] = "数字"
|
|
|
}
|
|
|
- if (element.isOnlyMark == true) {
|
|
|
- element.isOnlyMarkName = "是";
|
|
|
- } else {
|
|
|
- element.isOnlyMarkName = "否";
|
|
|
+ else if(item.dataType==3){
|
|
|
+ item['dataTypeText'] = "时间"
|
|
|
}
|
|
|
- });
|
|
|
+ else if(item.dataType==4){
|
|
|
+ item['dataTypeText'] = "日期"
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ item['dataTypeText'] = "其他"
|
|
|
+ }
|
|
|
+ if(item.isKey==1){
|
|
|
+ item['isKeyText'] = "是"
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ item['isKeyText'] = "否"
|
|
|
+ }
|
|
|
+ if(item.isMust==1){
|
|
|
+ item['isMustText'] = "是"
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ item['isMustText'] = "否"
|
|
|
+ }
|
|
|
+ if(item.isSplite==1){
|
|
|
+ item['isSpliteText'] = "是"
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ item['isSpliteText'] = "否"
|
|
|
+ }
|
|
|
+ })
|
|
|
this.posArr = translateDataToTreeAll(
|
|
|
result.returnData,
|
|
|
- "parentItemID",
|
|
|
- "id"
|
|
|
+ "parentID",
|
|
|
+ "ItemID"
|
|
|
);
|
|
|
this.posArr.forEach((res, index) => {
|
|
|
res.index = index + 1;
|
|
|
+ if(res.children.length<1){
|
|
|
+ delete res.children
|
|
|
+ }
|
|
|
});
|
|
|
- this.dataitem = result.returnData;
|
|
|
- }
|
|
|
- },
|
|
|
- //保存
|
|
|
- async storagemod() {
|
|
|
- let params = {
|
|
|
- id: this.dataStoreid,
|
|
|
- targetName: this.ruleForm.name, //储存名称
|
|
|
- targetCode: this.ruleForm.fullName, //储存标识
|
|
|
- saveType: this.ruleForm.tag, //储存类型
|
|
|
- saveInfo: this.ruleForm.code, //储存目标
|
|
|
- status: this.analyList[0].status,
|
|
|
- };
|
|
|
- const result = await Datastoragemod(params);
|
|
|
- if (result.code == 0) {
|
|
|
- this.$message.success("成功");
|
|
|
- this.$router.push("/dataStore");
|
|
|
} else {
|
|
|
- this.$message.error(result.message);
|
|
|
- }
|
|
|
- },
|
|
|
- //数据存储列
|
|
|
- async DatastorageList() {
|
|
|
- const result = await Datastorage();
|
|
|
- if (result.code == 0) {
|
|
|
- this.analyList = result.returnData.filter(
|
|
|
- (i) => i.id == this.dataStoreid
|
|
|
- );
|
|
|
- this.ruleForm.name = this.analyList[0].targetName; //储存名称
|
|
|
- this.ruleForm.fullName = this.analyList[0].targetCode; //储存标识
|
|
|
- this.ruleForm.tag = this.analyList[0].saveType; //储存类型
|
|
|
- this.ruleForm.code = this.analyList[0].saveInfo; //储存目标
|
|
|
+ this.$message.error(res.message ?? "失败");
|
|
|
}
|
|
|
},
|
|
|
//搜索
|
|
@@ -543,54 +553,31 @@ export default {
|
|
|
clearSearchData() {
|
|
|
this.posArr = this.posArrCopy;
|
|
|
},
|
|
|
- //编辑信息
|
|
|
- handleEdit(index, row) {
|
|
|
- this.rmObj = row;
|
|
|
- this.rmIndex = index;
|
|
|
- this.msgType = 2;
|
|
|
- this.addFlag = true;
|
|
|
- const {
|
|
|
- id,
|
|
|
- itemName,
|
|
|
- itemCode,
|
|
|
- dataType,
|
|
|
- isOnlyMark,
|
|
|
- canNull,
|
|
|
- sourceDataAnalysisId,
|
|
|
- dataLevel,
|
|
|
- parentItemID,
|
|
|
- analysisDataItemSourceId,
|
|
|
- } = row;
|
|
|
- this.dataForm.id = id;
|
|
|
- this.dataForm.name = itemName;
|
|
|
- this.dataForm.code = itemCode;
|
|
|
- this.dataForm.tag = Number(dataType);
|
|
|
- this.dataForm.uninq = isOnlyMark === true ? "1" : "0";
|
|
|
- this.dataForm.isnull = canNull === true ? "1" : "0";
|
|
|
- this.dataForm.datas = sourceDataAnalysisId;
|
|
|
- this.dataForm.priority = dataLevel;
|
|
|
- this.dataForm.demo = parentItemID == 0 ? null : parentItemID;
|
|
|
- this.sourceider = analysisDataItemSourceId;
|
|
|
- },
|
|
|
//删除信息
|
|
|
handleDelete(index, row) {
|
|
|
this.rmObj = row;
|
|
|
this.rmIndex = index;
|
|
|
this.flag = true;
|
|
|
- this.deleID = row.id;
|
|
|
+ this.deleID = row.ItemID;
|
|
|
},
|
|
|
//删除
|
|
|
async remove() {
|
|
|
- let params = {
|
|
|
- id: this.deleID,
|
|
|
- };
|
|
|
- const result = await storageListdel(params);
|
|
|
- if (result.code == 0) {
|
|
|
- this.$message.success("成功");
|
|
|
- } else {
|
|
|
- this.$message.error(result.message);
|
|
|
+ this.rmObj["operate"] = "3";
|
|
|
+ try {
|
|
|
+ const res = await GeneralDataReception({
|
|
|
+ serviceId: "5",
|
|
|
+ dataContent: JSON.stringify(this.rmObj),
|
|
|
+ });
|
|
|
+ if (res.code === "0") {
|
|
|
+ this.removeDialogVisible = false;
|
|
|
+ this.$message.success("删除成功");
|
|
|
+ this.getDataList()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.message ?? "失败");
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log("错误", error);
|
|
|
}
|
|
|
- this.storagedetails();
|
|
|
this.flag = false;
|
|
|
},
|
|
|
//新增数据项
|
|
@@ -598,67 +585,64 @@ export default {
|
|
|
this.msgType = 1;
|
|
|
this.addFlag = true;
|
|
|
},
|
|
|
- //存储数据项-提交
|
|
|
+ handleAdd(index,row){
|
|
|
+ this.msgType = 1;
|
|
|
+ this.addFlag = true;
|
|
|
+ this.dataForm.parentID = row.ItemID;
|
|
|
+ this.dataForm.parentIDs = [row.ItemID];
|
|
|
+ },
|
|
|
+ handleEdit(index,row){
|
|
|
+ this.msgType = 2;
|
|
|
+ this.addFlag = true;
|
|
|
+ this.dataForm = row;
|
|
|
+ this.dataForm.parentIDs = [row.parentID];
|
|
|
+ this.dataForm.isKey = this.dataForm.isKey+""
|
|
|
+ this.dataForm.isMust = this.dataForm.isMust+""
|
|
|
+ this.dataForm.isSplite = this.dataForm.isSplite+""
|
|
|
+ },
|
|
|
+ handleChange(data){
|
|
|
+ this.dataForm.parentID = data[data.length-1]
|
|
|
+ },
|
|
|
+ //数据项-提交
|
|
|
async addSubmit(formName) {
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- // this.$message.success("提交成功");
|
|
|
- // this.resetForm(formName);
|
|
|
+ if(this.dataForm.ItemID){
|
|
|
+ this.dataForm["operate"] = "2";
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.dataForm["operate"] = "1";
|
|
|
+ }
|
|
|
+ this.dataForm["sourceDataID"] = this.dataStoreid;
|
|
|
+ this.saveData();
|
|
|
} else {
|
|
|
console.log("error submit!!");
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
- if (this.msgType === 1) {
|
|
|
- let params = {
|
|
|
- id: "",
|
|
|
- targetDataID: this.dataStoreid,
|
|
|
- parentItemID: this.dataForm.demo ? this.dataForm.demo : 0, //所属数据项
|
|
|
- itemName: this.dataForm.name, //名称
|
|
|
- itemCode: this.dataForm.code, //标识
|
|
|
- dataType: this.dataForm.tag, //数据类型
|
|
|
- isOnlyMark: this.dataForm.uninq == 1 ? true : false, //唯一项标志
|
|
|
- canNull: this.dataForm.isnull == 1 ? true : false, //允许空值
|
|
|
- sourceDataAnalysisId: this.dataForm.datas, //取值来源
|
|
|
- dataLevel: this.dataForm.priority, //取值优先级
|
|
|
- };
|
|
|
- const result = await storageListadd(params);
|
|
|
- if (result.code == 0) {
|
|
|
- this.storagedetails();
|
|
|
- this.$message.success("成功");
|
|
|
- this.resetForm(formName);
|
|
|
- this.dataForm = this.$options.data().dataForm;
|
|
|
- this.sourceider = null;
|
|
|
- }
|
|
|
- } else {
|
|
|
- let params = {
|
|
|
- id: this.dataForm.id,
|
|
|
- targetDataID: this.dataStoreid,
|
|
|
- parentItemID: this.dataForm.demo ? this.dataForm.demo : 0, //所属数据项
|
|
|
- itemName: this.dataForm.name, //名称
|
|
|
- itemCode: this.dataForm.code, //标识
|
|
|
- dataType: this.dataForm.tag, //数据类型
|
|
|
- isOnlyMark: this.dataForm.uninq == 1 ? true : false, //唯一项标志
|
|
|
- canNull: this.dataForm.isnull == 1 ? true : false, //允许空值
|
|
|
- sourceDataAnalysisId: this.dataForm.datas, //取值来源
|
|
|
- dataLevel: this.dataForm.priority, //取值优先级
|
|
|
- };
|
|
|
- const result = await storageListadd(params);
|
|
|
- if (result.code == 0) {
|
|
|
- this.storagedetails();
|
|
|
- this.$message.success("成功");
|
|
|
- this.resetForm(formName);
|
|
|
- this.dataForm = this.$options.data().dataForm;
|
|
|
- this.sourceider = null;
|
|
|
- }
|
|
|
- this.resetForm(formName);
|
|
|
- }
|
|
|
+ },
|
|
|
+ async saveData(){
|
|
|
+ try {
|
|
|
+ const res = await GeneralDataReception({
|
|
|
+ serviceId: "5",
|
|
|
+ dataContent: JSON.stringify(this.dataForm),
|
|
|
+ });
|
|
|
+ if (res.code === "0") {
|
|
|
+ this.$message.success(res.message ?? "成功");
|
|
|
+ this.getDataList();
|
|
|
+ this.resetForm("dataForm");
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.message ?? "失败");
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log("错误", error);
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
//存储数据项-取消
|
|
|
resetForm(formName) {
|
|
|
this.addFlag = false;
|
|
|
- this.dataForm = this.$options.data().dataForm;
|
|
|
- this.sourceider = null;
|
|
|
+ this.dataForm = {};
|
|
|
this.$refs[formName].resetFields();
|
|
|
},
|
|
|
},
|