| | |
| | | <template> |
| | | <div class="dictionaryBox"> |
| | | <My-bread :list="[ |
| | | `${$t('dataManage.dataManage')}`, |
| | | `${$t('dataManage.dictionaryManage')}`, |
| | | ]"></My-bread> |
| | | `${$t('dataManage.dataManage')}`, |
| | | `${$t('dataManage.dataAnalysis')}`, |
| | | ]"></My-bread> |
| | | <el-divider /> |
| | | <div class="mainBox"> |
| | | <div class="mainHeader"> |
| | | |
| | | <div |
| | | class="dictionary_leftTree subpage_Div" |
| | | style="border: 1px solid #dcdfe6;" |
| | | > |
| | | <el-input |
| | | size="small" |
| | | v-model="filterInput" |
| | | style="width: 200px" |
| | | :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueone')" |
| | | suffix-icon="el-icon-search" |
| | | ></el-input> |
| | | <!-- <el-tree |
| | | :data="domainData" |
| | | :props="defaultProps" |
| | | > |
| | | <el-form :model="formInline" :inline="true" class="demo-form-inline"> |
| | | <el-form-item label="上传数据"> |
| | | <el-input v-model="formInline.file" size="small" disabled placeholder="请选择要上传的数据"> <i slot="suffix" |
| | | class="el-input__icon el-icon-upload2" @click="setFileInsert"></i></el-input> |
| | | |
| | | </el-tree> --> |
| | | <el-tree |
| | | :data="domainData" |
| | | :props="defaultProps" |
| | | @node-click="getTableDesc" |
| | | :filter-node-method="filterNode" |
| | | ref="tree" |
| | | ></el-tree> |
| | | <!-- <ul> |
| | | <li |
| | | @click="getTableDesc(item)" |
| | | v-for="(item, i) in optionCount" |
| | | :class="{ active: activeName == item.tab }" |
| | | :key="i" |
| | | > |
| | | {{ item.tabDesc }} |
| | | </li> |
| | | </ul> --> |
| | | |
| | | <input size="small" id="selectDataFile" type="file" style="display: none;" accept=".xlsx,.xls" |
| | | @change="handleSelectFileChange"></input> |
| | | |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button class="el-button--small" type="primary" size="mini" icon="el-icon-setting" |
| | | @click="setLoadingTrue">分析</el-button> |
| | | <el-button class="el-button--small" size="mini" icon="el-icon-refresh" @click="setRefresh">重置</el-button> |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | | |
| | | </div> |
| | | |
| | | <div class="right subpage_Div"> |
| | | <div class="inquire"> |
| | | <el-form |
| | | :inline="true" |
| | | :model="formInline" |
| | | class="demo-form-inline" |
| | | > |
| | | <el-form-item |
| | | size="small" |
| | | :label="$t('dataManage.dictionaryManageObj.tableName')" |
| | | > |
| | | <el-input |
| | | v-model="formInline.tab" |
| | | :placeholder="$t('shuJuGuanLi.lable3')" |
| | | style="width: 200px" |
| | | ><i |
| | | slot="suffix" |
| | | class="el-icon-search" |
| | | @click="getSelectDictTab" |
| | | style="padding-right: 8px" |
| | | ></i></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | style="float: right" |
| | | size="small" |
| | | > |
| | | <el-button |
| | | v-if="btnStatus.insert" |
| | | icon="el-icon-edit" |
| | | size="small" |
| | | @click="InsertFormdialog = true" |
| | | type="success" |
| | | >{{ $t("common.append") }}</el-button> |
| | | <el-button |
| | | v-if="btnStatus.delete" |
| | | icon="el-icon-delete" |
| | | size="small" |
| | | @click="DelFormData" |
| | | type="danger" |
| | | >{{ $t("common.delete") }}</el-button> |
| | | <!-- <el-button |
| | | icon="el-icon-search" |
| | | size="small" |
| | | @click="getSelectDictTab" |
| | | class="primary" |
| | | >{{ $t("common.iquery") }}</el-button>--> |
| | | <el-button |
| | | icon="el-icon-refresh" |
| | | size="small" |
| | | @click="getRemoveForm" |
| | | type="info" |
| | | >{{ $t("common.reset") }}</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div class="dividing-line"></div> |
| | | <div |
| | | class="table_box" |
| | | style="height:calc(100% - 50px)" |
| | | > |
| | | <el-table |
| | | :data="tableData" |
| | | style="width: 100%" |
| | | border |
| | | @selection-change="handleSelectionChange" |
| | | height="calc(100% - 57px)" |
| | | > |
| | | <el-table-column |
| | | type="selection" |
| | | width="55" |
| | | /> |
| | | <el-table-column |
| | | type="index" |
| | | width="50" |
| | | :label="$t('common.index')" |
| | | ></el-table-column> |
| | | <!-- <el-table-column |
| | | prop="orderNum" |
| | | :label="$t('dataManage.dictionaryManageObj.number')" |
| | | /> --> |
| | | <el-table-column |
| | | min-width="100" |
| | | prop="field" |
| | | :label="$t('dataManage.dictionaryManageObj.fieldName')" |
| | | /> |
| | | <el-table-column |
| | | min-width="120" |
| | | prop="alias" |
| | | :label="$t('dataManage.dictionaryManageObj.fieldAliasName')" |
| | | /> |
| | | <el-table-column |
| | | min-width="100" |
| | | prop="type" |
| | | :label="$t('dataManage.dictionaryManageObj.fieldType')" |
| | | /> |
| | | <el-table-column |
| | | min-width="80" |
| | | prop="len" |
| | | :label="$t('dataManage.dictionaryManageObj.fieldLength')" |
| | | /> |
| | | <el-table-column |
| | | min-width="80" |
| | | prop="precision" |
| | | :label="$t('dataManage.dictionaryManageObj.FieldPrecision')" |
| | | /> |
| | | <el-table-column |
| | | min-width="100" |
| | | prop="tab" |
| | | :label=" |
| | | $t('dataManage.dictionaryManageObj.tableName') |
| | | " |
| | | /> |
| | | <el-table-column |
| | | min-width="100" |
| | | prop="bak" |
| | | :label="$t('dataManage.dictionaryManageObj.remark')" |
| | | /> |
| | | <el-table-column |
| | | min-width="100" |
| | | prop="createTime" |
| | | :label="$t('dataManage.dictionaryManageObj.creationTime')" |
| | | :formatter="formatData" |
| | | /> |
| | | <el-table-column |
| | | min-width="100" |
| | | prop="createName" |
| | | :label="$t('dataManage.dictionaryManageObj.createPersonnel')" |
| | | /> |
| | | <el-table-column |
| | | min-width="100" |
| | | prop="updateTime" |
| | | :label="$t('dataManage.dictionaryManageObj.updateTime')" |
| | | :formatter="formatData" |
| | | /> |
| | | <el-table-column |
| | | min-width="100" |
| | | prop="updateName" |
| | | :label="$t('dataManage.dictionaryManageObj.updatePersonnel')" |
| | | /> |
| | | <el-divider /> |
| | | |
| | | <el-table-column |
| | | min-width="180" |
| | | :label="$t('dataManage.dictionaryManageObj.operation')" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | size="small" |
| | | v-if="btnStatus.select" |
| | | @click="showDetail(scope.$index, scope.row)" |
| | | >{{ $t("dataManage.dictionaryManageObj.lookOver") }}</el-button> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | size="small" |
| | | v-if="btnStatus.update" |
| | | @click="handleEdit(scope.$index, scope.row)" |
| | | style="margin-left: 10px" |
| | | >{{ $t("dataManage.dictionaryManageObj.revamp") }}</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <div class="mainContent"> |
| | | <!-- <div > --> |
| | | <el-carousel v-show="showTable == false" style="height: 100%;"> |
| | | <el-carousel-item v-for=" (item, key) in imgOption" :key="key"> |
| | | |
| | | <el-image class="image" :src="item.url" :preview-src-list="item.srcList"> |
| | | </el-image> |
| | | </el-carousel-item> |
| | | </el-carousel> |
| | | |
| | | |
| | | <el-table v-show="showTable == true" style="w5d" :data="tableData"> |
| | | <el-table-column v-for="(item, index) in tableDataHeader" :key="index" align="center" :prop="item.name |
| | | " :label="item.name"></el-table-column> |
| | | </el-table> |
| | | <div |
| | | class="pagination_box" |
| | | style="margin-top: 15px" |
| | | > |
| | | <el-pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="listData.pageIndex" |
| | | :page-sizes="[10, 50, 100, 200]" |
| | | :page-size="listData.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="count" |
| | | > |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | <div |
| | | class="infoBox_box" |
| | | v-show="showinfoBox" |
| | | > |
| | | <div class="infoBox box_div"> |
| | | <div |
| | | slot="header" |
| | | class="clearfix" |
| | | > |
| | | <span>{{ $t("dataManage.dictionaryManageObj.particulars") }}</span> |
| | | <div |
| | | style="float: right; cursor: pointer" |
| | | @click="closeDetial" |
| | | > |
| | | <i class="el-icon-close"></i> |
| | | </div> |
| | | </div> |
| | | <el-divider></el-divider> |
| | | <div class="contentBox"> |
| | | <p> |
| | | {{ $t("dataManage.dictionaryManageObj.tableName") }}:{{ |
| | | itemdetail.tab |
| | | }} |
| | | </p> |
| | | <el-divider></el-divider> |
| | | <p> |
| | | {{ $t("dataManage.dictionaryManageObj.tableAliasName") }}:{{ |
| | | itemdetail.tabDesc |
| | | }} |
| | | </p> |
| | | <el-divider></el-divider> |
| | | |
| | | <p> |
| | | {{ $t("dataManage.dictionaryManageObj.fieldName") }}:{{ |
| | | itemdetail.field |
| | | }} |
| | | </p> |
| | | <el-divider></el-divider> |
| | | <p> |
| | | {{ $t("dataManage.dictionaryManageObj.fieldAliasName") }}:{{ |
| | | itemdetail.alias |
| | | }} |
| | | </p> |
| | | <el-divider></el-divider> |
| | | <p> |
| | | {{ $t("dataManage.dictionaryManageObj.fieldType") }}:{{ |
| | | itemdetail.type |
| | | }} |
| | | </p> |
| | | <el-divider></el-divider> |
| | | <p> |
| | | {{ $t("dataManage.dictionaryManageObj.fieldLength") }}:{{ |
| | | itemdetail.len |
| | | }} |
| | | </p> |
| | | <el-divider></el-divider> |
| | | <p> |
| | | {{ $t("dataManage.dictionaryManageObj.FieldPrecision") }}:{{ |
| | | itemdetail.precision |
| | | }} |
| | | </p> |
| | | <el-divider></el-divider> |
| | | |
| | | <p> |
| | | {{ $t("dataManage.dictionaryManageObj.remark") }}:{{ |
| | | itemdetail.bak |
| | | }} |
| | | </p> |
| | | <el-divider></el-divider> |
| | | <p> |
| | | {{ $t("dataManage.dictionaryManageObj.creationTime") }}:{{ |
| | | itemdetail.createTime |
| | | }} |
| | | </p> |
| | | <el-divider></el-divider> |
| | | <p> |
| | | {{ $t("dataManage.dictionaryManageObj.createPersonnel") }}:{{ |
| | | itemdetail.createUser |
| | | }} |
| | | </p> |
| | | <el-divider></el-divider> |
| | | <p> |
| | | {{ $t("dataManage.dictionaryManageObj.updateTime") }}:{{ |
| | | itemdetail.updateTime |
| | | }} |
| | | </p> |
| | | <el-divider></el-divider> |
| | | <p> |
| | | {{ $t("dataManage.dictionaryManageObj.updatePersonnel") }}:{{ |
| | | itemdetail.updateUser |
| | | }} |
| | | </p> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | top="2vh" |
| | | :title="$t('dataManage.dictionaryManageObj.revamp')" |
| | | :visible.sync="dialogFormVisible" |
| | | :before-close="handleClose" |
| | | > |
| | | <div style="height: 500px; overflow: auto"> |
| | | <el-form |
| | | :model="upform" |
| | | label-position="top" |
| | | > |
| | | <el-form-item |
| | | :label="$t('dataManage.dictionaryManageObj.number')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="upform.orderNum" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('dataManage.dictionaryManageObj.tableName')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="upform.tab" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('dataManage.dictionaryManageObj.tableAliasName')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="upform.tabDesc" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | ></el-input> |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | :label="$t('dataManage.dictionaryManageObj.fieldName')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="upform.field" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('dataManage.dictionaryManageObj.fieldAliasName')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="upform.alias" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('dataManage.dictionaryManageObj.fieldType')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="upform.type" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('dataManage.dictionaryManageObj.fieldLength')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="upform.len" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('dataManage.dictionaryManageObj.FieldPrecision')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="upform.precision" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | ></el-input> |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | :label="$t('dataManage.dictionaryManageObj.remark')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="upform.bak" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div |
| | | slot="footer" |
| | | class="dialog-footer" |
| | | > |
| | | <el-button |
| | | type="info" |
| | | size="small" |
| | | @click="handleClose" |
| | | >{{ $t("dataManage.dictionaryManageObj.cancel") }}</el-button> |
| | | <el-button |
| | | class="primary" |
| | | size="small" |
| | | @click="updateForm" |
| | | >{{ |
| | | $t("dataManage.dictionaryManageObj.confirm") |
| | | }}</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog |
| | | :title="$t('dataManage.dictionaryManageObj.add')" |
| | | top="2vh" |
| | | :visible.sync="InsertFormdialog" |
| | | :before-close="handleCloseadd" |
| | | > |
| | | <div style="height: 500px; overflow: auto"> |
| | | <el-form |
| | | :model="insertform" |
| | | label-position="top" |
| | | > |
| | | <el-form-item |
| | | :label="$t('dataManage.dictionaryManageObj.number')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="insertform.orderNum" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuenumber')" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('dataManage.dictionaryManageObj.tableName')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="insertform.tab" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetableName')" |
| | | disabled |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('dataManage.dictionaryManageObj.tableAliasName')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="insertform.tabDesc" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | :placeholder="$t('shuJuGuanLi.shuJuJianSuo.tableDisplayName')" |
| | | ></el-input> |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | :label="$t('dataManage.dictionaryManageObj.fieldName')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="insertform.field" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuefieldName')" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('dataManage.dictionaryManageObj.fieldAliasName')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="insertform.alias" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuefieldDisplayName')" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('dataManage.dictionaryManageObj.fieldType')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="insertform.type" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuefieldType')" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('dataManage.dictionaryManageObj.fieldLength')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="insertform.len" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuefieldLength')" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('dataManage.dictionaryManageObj.FieldPrecision')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="insertform.precision" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('dataManage.dictionaryManageObj.FieldPrecision')" |
| | | ></el-input> |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | :label="$t('dataManage.dictionaryManageObj.remark')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="insertform.bak" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('dataManage.dictionaryManageObj.remark')" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div |
| | | slot="footer" |
| | | class="dialog-footer" |
| | | > |
| | | <el-button |
| | | type="info" |
| | | size="small" |
| | | @click="handleCloseadd" |
| | | >{{ |
| | | $t("dataManage.dictionaryManageObj.cancel") |
| | | }}</el-button> |
| | | <el-button |
| | | type="primary" |
| | | size="small" |
| | | @click="insertFromData" |
| | | >{{ |
| | | $t("dataManage.dictionaryManageObj.confirm") |
| | | }}</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { |
| | | selectByPageAndCount, |
| | | selectDictTab, |
| | | deleteDicts, |
| | | updateDict, |
| | | insertDict, |
| | | scatterplot |
| | | } from "../../api/api"; |
| | | import MyBread from "../../components/MyBread.vue"; |
| | | import { conditions } from '../Archive/Archive'; |
| | | import $ from "jquery"; |
| | | import { |
| | | getTreeData |
| | | } from "../../utils/treeData.js" |
| | | import { nextTick } from 'vue'; |
| | | import XLSX from 'xlsx' |
| | | |
| | | export default { |
| | | name: "dictionaryManage", |
| | | components: { MyBread }, |
| | | data() { |
| | | return { |
| | | filterInput: "", |
| | | activeName: "", |
| | | formInline: [], |
| | | listData: { |
| | | ns: "", |
| | | tab: "", |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | }, |
| | | count: 0, |
| | | InsertFormdialog: false, |
| | | optionCount: [], |
| | | tableData: [], |
| | | showinfoBox: false, |
| | | dialogFormVisible: false, |
| | | itemdetail: {}, |
| | | upform: {}, |
| | | insertform: {}, |
| | | formInline: { |
| | | file: null, |
| | | |
| | | multipleSelection: [], |
| | | formLabelWidth: "130px", |
| | | btnStatus: { |
| | | select: false, |
| | | delete: false, |
| | | upload: false, |
| | | download: false, |
| | | insert: false, |
| | | update: false, |
| | | }, |
| | | domainData: [], |
| | | defaultProps: { |
| | | children: "children", |
| | | label: "label", |
| | | }, |
| | | showTable: true, |
| | | loading: false, |
| | | imgOption: [ |
| | | |
| | | ], |
| | | tableDataHeader: [], |
| | | tableData: [], |
| | | }; |
| | | }, |
| | | watch: { |
| | | |
| | | filterInput(val) { |
| | | this.$refs.tree.filter(val); |
| | | }, |
| | | |
| | | }, |
| | | created() { |
| | | this.getSelectDictTab(); |
| | | this.showPermsBtn(); |
| | | |
| | | }, |
| | | methods: { |
| | | filterNode(value, data) { |
| | | if (!value) return true; |
| | | setRefresh() { |
| | | this.formInline = { |
| | | file: null, |
| | | |
| | | return data.val.indexOf(value) !== -1; |
| | | }, |
| | | //新增 |
| | | async insertFromData() { |
| | | const data = await insertDict(this.insertform); |
| | | if (data.code != 200) { |
| | | } |
| | | this.InsertFormdialog = false; |
| | | this.insertform = {}; |
| | | this.startQueryNameData(); |
| | | this.showTable = true; |
| | | this.tableDataHeader = [] |
| | | this.tableData = [] |
| | | }, |
| | | setFileInsert() { |
| | | $("#selectDataFile").click(); |
| | | }, |
| | | handleSelectFileChange(event) { |
| | | |
| | | //查看详情 |
| | | showDetail(index, row) { |
| | | this.showinfoBox = true; |
| | | this.itemdetail = row; |
| | | }, |
| | | closeDetial() { |
| | | this.showinfoBox = false; |
| | | this.itemdetail = {}; |
| | | }, |
| | | //获取表格字段信息 |
| | | getTableDesc(res) { |
| | | if (res.children) { |
| | | return |
| | | } |
| | | var val = JSON.parse(JSON.stringify(res)) |
| | | this.insertform.tab = val.tab; |
| | | this.insertform.tabDesc = val.tabDesc; |
| | | this.insertform.ns = val.ns; |
| | | this.activeName = val.tab; |
| | | this.listData.tab = val.tab; |
| | | this.listData.ns = val.ns; |
| | | this.startQueryNameData(); |
| | | }, |
| | | async startQueryNameData() { |
| | | if (this.listData.tab == "") { |
| | | delete this.listData.tab; |
| | | } |
| | | this.tableData = []; |
| | | const data = await selectByPageAndCount(this.listData); |
| | | var that = this |
| | | // 拿取文件对象 |
| | | let f = event.currentTarget.files[0] |
| | | this.formInline.file = f.name |
| | | // 用FileReader来读取 |
| | | let reader = new FileReader() |
| | | // 重写FileReader上的readAsBinaryString方法 |
| | | FileReader.prototype.readAsBinaryString = function (f) { |
| | | let binary = '' |
| | | let wb // 读取完成的数据 |
| | | let outdata // 你需要的数据 |
| | | let reader = new FileReader() |
| | | |
| | | if (data.code != 200) { |
| | | this.$message.error("列表调用失败"); |
| | | } |
| | | |
| | | this.tableData = data.result; |
| | | this.count = data.count; |
| | | }, |
| | | handleSelectionChange(res) { |
| | | this.multipleSelection = res; |
| | | }, |
| | | |
| | | handleSizeChange(val) { |
| | | this.listData.pageIndex = 1; |
| | | this.listData.pageSize = val; |
| | | this.startQueryNameData(); |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.listData.pageIndex = val; |
| | | this.startQueryNameData(); |
| | | }, |
| | | //修改详情 |
| | | async updateForm() { |
| | | const data = await updateDict(this.upform); |
| | | if (data.code != 200) { |
| | | this.$message.error("修改失败"); |
| | | return; |
| | | } |
| | | this.dialogFormVisible = false; |
| | | // this.startQueryNameData(); |
| | | this.startQueryNameData(); |
| | | }, |
| | | //修改详情弹框 |
| | | handleEdit(index, row) { |
| | | this.dialogFormVisible = true; |
| | | var val = JSON.parse(JSON.stringify(row)) |
| | | this.upform = val; |
| | | }, |
| | | //删除列表 |
| | | DelFormData() { |
| | | var std = []; |
| | | |
| | | for (var i in this.multipleSelection) { |
| | | std.push(this.multipleSelection[i].id); |
| | | } |
| | | this.$confirm("此操作将永久删除该字段, 是否继续?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(async () => { |
| | | const data = await deleteDicts({ ids: std.toString() }); |
| | | if (data.code != 200) { |
| | | this.$message.error("删除失败"); |
| | | reader.onload = function (e) { |
| | | // 读取成Uint8Array,再转换为Unicode编码(Unicode占两个字节) |
| | | let bytes = new Uint8Array(reader.result) |
| | | let length = bytes.byteLength |
| | | for (let i = 0; i < length; i++) { |
| | | binary += String.fromCharCode(bytes[i]) |
| | | } |
| | | this.listData.pageIndex = 1; |
| | | |
| | | // 接下来就是xlsx了,具体可看api |
| | | wb = XLSX.read(binary, { |
| | | type: 'binary' |
| | | }) |
| | | outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]) |
| | | var str = outdata[0]; |
| | | var std = []; |
| | | for (var key in str) { |
| | | |
| | | std.push({ name: key }) |
| | | |
| | | this.startQueryNameData(); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "删除成功!", |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | this.$message({ |
| | | type: "info", |
| | | message: "已取消删除", |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | showPermsBtn() { |
| | | let currentPerms = this.$store.state.currentPerms; |
| | | let permsEntity = this.$store.state.permsEntity; |
| | | permsEntity |
| | | .filter((item) => item.perms == currentPerms) |
| | | .map((item) => (this.btnStatus[item.tag.substr(1)] = true)); |
| | | }, |
| | | //格式化列表 |
| | | formatData(row, column) { |
| | | let data = row[column.property]; |
| | | if (data == null) { |
| | | return data; |
| | | } |
| | | return this.format(data); |
| | | }, |
| | | //格式化时间 |
| | | format(shijianchuo) { |
| | | //shijianchuo是整数,否则要parseInt转换 |
| | | var time = new Date(shijianchuo); |
| | | var y = time.getFullYear(); |
| | | var m = time.getMonth() + 1; |
| | | var d = time.getDate(); |
| | | // var h = time.getHours(); |
| | | // var mm = time.getMvinutes(); |
| | | // var s = time.getSeconds(); |
| | | return y + "-" + this.add0(m) + "-" + this.add0(d); |
| | | }, |
| | | //格式化时间 |
| | | add0(m) { |
| | | return m < 10 ? "0" + m : m; |
| | | }, |
| | | getRemoveForm() { |
| | | this.formInline.tab = null; |
| | | this.getSelectDictTab(); |
| | | }, |
| | | treeData(source) { |
| | | let cloneData = JSON.parse(JSON.stringify(source));// 对源数据深度克隆 |
| | | if (cloneData.length != 0) { |
| | | return cloneData.filter((father) => { |
| | | // 循环所有项 |
| | | let branchArr = cloneData.filter((child) => father.label == child.pname); // 对比ID,分别上下级菜单,并返回数据 |
| | | branchArr.length > 0 ? (father.children = branchArr) : ''; // 给父级添加一个children属性,并赋值 |
| | | // 属于同一对象问题,例如:令 a=b、c=1 ,然后再令 b.c=c , 那么 a.c=b.c=c=1 ;同理,后续令 c.d=2 ,那么 a.c.d 也是=2; |
| | | // 由此循环多次后,就能形成相应的树形数据结构 |
| | | return father.pname == -1; // 返回一级菜单 |
| | | }); |
| | | } |
| | | }, |
| | | //目录树获取 |
| | | async getSelectDictTab() { |
| | | const data = await selectDictTab({ name: this.formInline.tab }); |
| | | if (data.code != 200) { |
| | | this.$message.error("列表调用失败"); |
| | | } |
| | | var val = JSON.parse(JSON.stringify(data.result)); |
| | | var tree = getTreeData(data.result); |
| | | this.domainData = tree |
| | | this.getQueryNameData(tree[0]); |
| | | // var = this.domainData[0].children; |
| | | // |
| | | }, |
| | | getQueryNameData(res) { |
| | | |
| | | if (res.children) { |
| | | this.getQueryNameData(res.children); |
| | | } else { |
| | | |
| | | if (res.length != 1) { |
| | | if (res[0].children) { |
| | | this.getQueryNameData(res[0].children); |
| | | } else { |
| | | |
| | | var result = res[0] |
| | | this.insertform.tab = result.tab; |
| | | this.insertform.tabDesc = result.tabDesc; |
| | | this.insertform.ns = result.ns; |
| | | this.listData.tab = result.tab; |
| | | this.listData.ns = result.ns; |
| | | this.activeName = result.tab; |
| | | this.startQueryNameData(); |
| | | } |
| | | } else { |
| | | if (res.children) { |
| | | this.getQueryNameData(res.children); |
| | | } else { |
| | | var result = res |
| | | this.insertform.tab = result.tab; |
| | | this.insertform.tabDesc = result.tabDesc; |
| | | this.insertform.ns = result.ns; |
| | | this.listData.tab = result.tab; |
| | | this.listData.ns = result.ns; |
| | | this.activeName = result.tab; |
| | | this.startQueryNameData(); |
| | | } |
| | | that.tableDataHeader = std |
| | | that.tableData = outdata |
| | | } |
| | | |
| | | reader.readAsArrayBuffer(f) |
| | | } |
| | | reader.readAsBinaryString(f) |
| | | |
| | | }, |
| | | handleClose() { |
| | | this.$confirm("关闭后无法保存,是否关闭?") |
| | | .then((_) => { |
| | | this.dialogFormVisible = false |
| | | |
| | | setLoadingTrue() { |
| | | this.$store.state.setLoading = true; |
| | | var fs1 = document.getElementById("selectDataFile"); |
| | | if (fs1.files.length == 0) { |
| | | this.$store.state.setLoading = false; |
| | | return this.$message("请选择需要上传的数据文件"); |
| | | } |
| | | setTimeout(() => { |
| | | this.setFileAnalysis() |
| | | }, 1000); |
| | | }, |
| | | |
| | | setFileAnalysis() { |
| | | var that = this; |
| | | var fs1 = document.getElementById("selectDataFile"); |
| | | var formFile = new FormData(); |
| | | var fileObj = fs1.files[0] |
| | | formFile.append("file", fileObj); //加入文件对象 |
| | | $.ajax( |
| | | BASE_Fast_URL + "/scatterplot", |
| | | { |
| | | type: 'POST', |
| | | data: formFile, |
| | | async: true, |
| | | cache: false, |
| | | contentType: false, |
| | | processData: false, |
| | | success: (rs) => { |
| | | that.showTable = false; |
| | | that.setShowImage(rs); |
| | | |
| | | }, |
| | | error: (rs) => { |
| | | |
| | | }, |
| | | }) |
| | | .catch((_) => { }); |
| | | }, |
| | | handleCloseadd() { |
| | | this.$confirm("关闭后无法保存,是否关闭?") |
| | | .then((_) => { |
| | | this.InsertFormdialog = false |
| | | this.insertform = {}; |
| | | }) |
| | | .catch((_) => { }); |
| | | }, |
| | | }, |
| | | setShowImage(res) { |
| | | this.$store.state.setLoading = false; |
| | | |
| | | var imgUrl1 = BASE_Fast_URL + '/image?file_name=' + res.image1; |
| | | var imgUrl2 = BASE_Fast_URL + '/image?file_name=' + res.image2; |
| | | this.imgOption = [ |
| | | { |
| | | url: imgUrl1, |
| | | srcList: [imgUrl1] |
| | | }, { |
| | | url: imgUrl2, |
| | | srcList: [imgUrl2] |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style lang="less" scoped> |
| | |
| | | height: 98%; |
| | | width: 98%; |
| | | padding: 0.5%; |
| | | .dictionary_leftTree { |
| | | width: calc(23% - 0px); |
| | | height: 100%; |
| | | padding: 10px; |
| | | border-radius: 5px; |
| | | box-sizing: border-box; |
| | | overflow-y: auto; |
| | | li { |
| | | border-bottom: 1px solid #dcdfe6; |
| | | line-height: 30px; |
| | | text-align: center; |
| | | } |
| | | li:hover { |
| | | background: rgba(255, 255, 255, 0.3); |
| | | } |
| | | .active { |
| | | color: #409eff; |
| | | } |
| | | } |
| | | .dictionary_rightContent { |
| | | width: 80%; |
| | | height: 80%; |
| | | |
| | | border-radius: 5px; |
| | | padding: 1%; |
| | | overflow-y: auto; |
| | | } |
| | | |
| | | .infinite-list-item { |
| | | background: rgba(255, 255, 255, 0.3); |
| | | .mainBox { |
| | | padding-top: 10px; |
| | | width: 100%; |
| | | height: calc(100% - 50px); |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | margin-top: 5%; |
| | | padding: 1%; |
| | | text-align: center; |
| | | } |
| | | .eldivider { |
| | | margin-top: 0px; |
| | | margin-bottom: 10px; |
| | | } |
| | | } |
| | | .mainBox { |
| | | padding-top: 10px; |
| | | width: 100%; |
| | | height: calc(100% - 75px); |
| | | display: flex; |
| | | justify-content: space-around; |
| | | .leftTree { |
| | | width: calc(23% - 0px); |
| | | height: 100%; |
| | | padding: 10px; |
| | | border-radius: 5px; |
| | | box-sizing: border-box; |
| | | overflow-y: auto; |
| | | } |
| | | .right { |
| | | width: 75%; |
| | | height: 100%; |
| | | border-radius: 5px; |
| | | padding: 0 10px; |
| | | box-sizing: border-box; |
| | | border: 1px solid #dcdfe6; |
| | | .inquire { |
| | | // margin-bottom: 10px; |
| | | padding: 8px; |
| | | // margin-top: 10px; |
| | | border-radius: 5px; |
| | | //border: 1px solid #dcdfe6; |
| | | //margin-bottom: 20px; |
| | | .el-form-item { |
| | | margin: 5px; |
| | | .mainHeader { |
| | | margin-left: 20px; |
| | | |
| | | } |
| | | |
| | | .el-divider--horizontal { |
| | | margin: 10px 0px; |
| | | |
| | | } |
| | | |
| | | .mainContent { |
| | | flex: 1; |
| | | |
| | | .image { |
| | | width: 100%; |
| | | height: 98%; |
| | | } |
| | | |
| | | /deep/.el-carousel__container { |
| | | height: 100%; |
| | | |
| | | } |
| | | |
| | | /deep/.el-carousel__button { |
| | | background: #409EFF !important |
| | | } |
| | | } |
| | | } |
| | | |
| | | /deep/.el-button--small { |
| | | padding: 7px 15px !important; |
| | | } |
| | | |
| | | /deep/.el-form-item { |
| | | margin-bottom: 0px !important; |
| | | } |
| | | } |
| | | </style> |