1 |
- {"remainingRequest":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!E:\\boman-framwork\\ruoyi-ui\\src\\views\\tool\\gen\\editTable.vue?vue&type=style&index=0&lang=scss&","dependencies":[{"path":"E:\\boman-framwork\\ruoyi-ui\\src\\views\\tool\\gen\\editTable.vue","mtime":1619667088383},{"path":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\css-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\vue-loader\\lib\\loaders\\stylePostLoader.js","mtime":499162500000},{"path":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\postcss-loader\\src\\index.js","mtime":499162500000},{"path":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\sass-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCi5wYWdpbmF0aW9uLWNvbnRhaW5lciB7CiAgaGVpZ2h0OiAzNXB4Owp9CgoucmVzaXplTm9uZSB7CiAgd2lkdGg6IDYwdnc7CiAgYm9yZGVyLXJhZGl1czogM3B4OwoKICAuZWwtdGV4dGFyZWFfX2lubmVyIHsKICAgIC8vZWxfaW5wdXTkuK3nmoTpmpDol4/lsZ7mgKcKICAgIHJlc2l6ZTogbm9uZTsgLy/kuLvopoHmmK/ov5nkuKrmoLflvI8KICAgIGhlaWdodDogMjAwcHg7CiAgfQp9Cg=="},{"version":3,"sources":["editTable.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2+BA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA","file":"editTable.vue","sourceRoot":"src/views/tool/gen","sourcesContent":["<template>\r\n <el-card>\r\n <el-row type=\"flex\" justify=\"space-between\">\r\n <el-col :span=\"1.5\" style=\"display: flex; align-items: center;\">\r\n <el-form label-width=\"100px\" style=\"display: flex; align-items: center;\">\r\n <el-form-item style=\"text-align: center;margin: 0 0 0 -100px;\">\r\n <el-button size=\"mini\" type=\"primary\" v-if=\"activeName=='basic' || activeName=='cloum'\" @click=\"submitForm()\">保存</el-button>\r\n <el-button size=\"mini\" @click=\"close()\">返回</el-button>\r\n </el-form-item>\r\n </el-form>\r\n </el-col>\r\n </el-row>\r\n\r\n <el-tabs v-model=\"activeName\">\r\n <el-tab-pane label=\"基本信息\" name=\"basic\">\r\n <basic-info-form ref=\"basicInfo\" :info=\"info\" />\r\n </el-tab-pane>\r\n <el-tab-pane label=\"字段信息\" name=\"cloum\">\r\n <el-row type=\"flex\" style=\"margin-bottom: 20px;\" v-if=\"activeName=='cloum'\" :gutter=\"10\" justify=\"end\">\r\n <el-col :span=\"1.5\" style=\"display: flex; align-items: center;\">\r\n <el-button style=\"background-color: #FFE9ED;color: #E58481;border: 1px solid #E58481;\" type=\"warning\" plain\r\n icon=\"el-icon-plus\" size=\"mini\" @click=\"handleAdd\" v-hasPermi=\"['system:post:add']\">新增</el-button>\r\n </el-col>\r\n <el-col :span=\"1.5\" style=\"display: flex; align-items: center;\">\r\n <el-button type=\"danger\" plain icon=\"el-icon-delete\" size=\"mini\" :disabled=\"multiple\" @click=\"handleDelete\"\r\n v-hasPermi=\"['system:post:remove']\" style=\"background-color: #FFD6B0;color: #EA551A;border: 1px solid #F4AD6B;\">删除</el-button>\r\n </el-col>\r\n <!-- <right-toolbar :showSearch.sync=\"showSearch\" @queryTable=\"getList\"></right-toolbar> -->\r\n </el-row>\r\n <el-table ref=\"dragTable\" @row-dblclick=\"dbSelectedZd\" align=\"center\" :data=\"cloumns\" row-key=\"columnId\"\r\n :max-height=\"tableHeight\" @selection-change=\"handleSelectionChange\">\r\n <el-table-column type=\"selection\" width=\"55\" align=\"center\" />\r\n <el-table-column label=\"序号\" type=\"index\" min-width=\"5%\" class-name=\"allowDrag\" align=\"center\" />\r\n <el-table-column label=\"字段列名\" prop=\"columnName\" min-width=\"10%\" :show-overflow-tooltip=\"true\" align=\"center\" />\r\n <el-table-column label=\"字段描述\" min-width=\"10%\" align=\"center\">\r\n <template slot-scope=\"scope\">\r\n <el-input v-model=\"scope.row.columnComment\"></el-input>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"物理类型\" prop=\"columnType\" align=\"center\" min-width=\"10%\" :show-overflow-tooltip=\"true\" />\r\n <el-table-column label=\"字段显示规则\" align=\"center\" prop=\"mask\" min-width=\"13%\" />\r\n <el-table-column label=\"排序\" min-width=\"8%\" align=\"center\" prop=\"sort\" />\r\n <el-table-column label=\"输入字段\" min-width=\"10%\" align=\"center\">\r\n <template slot-scope=\"scope\">\r\n <el-checkbox true-label=\"Y\" false-label=\"N\" v-model=\"scope.row.isIn\"></el-checkbox>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"显示字段\" min-width=\"10%\" align=\"center\">\r\n <template slot-scope=\"scope\">\r\n <el-checkbox true-label=\"Y\" false-label=\"N\" v-model=\"scope.row.isOut\"></el-checkbox>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"查询\" min-width=\"8%\" align=\"center\">\r\n <template slot-scope=\"scope\">\r\n <el-checkbox true-label=\"1\" false-label=\"0\" v-model=\"scope.row.isQuery\"></el-checkbox>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"关联HR字段\" min-width=\"13%\" align=\"center\" prop=\"hrParentId\">\r\n <template slot-scope=\"scope\">\r\n <div>\r\n {{scope.row.hrParentName}}\r\n </div>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"缺省值\" min-width=\"10%\" align=\"center\" prop=\"defaultValue\" />\r\n <el-table-column label=\"外键\" min-width=\"10%\" align=\"center\" prop=\"foreignKey\">\r\n <template slot-scope=\"scope\">\r\n <div>\n {{scope.row.foreignKeyName}}\r\n </div>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"必填\" min-width=\"8%\" align=\"center\">\r\n <template slot-scope=\"scope\">\r\n <el-checkbox true-label=\"1\" false-label=\"0\" v-model=\"scope.row.isRequired\"></el-checkbox>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"显示类型\" min-width=\"12%\" align=\"center\">\r\n <template slot-scope=\"scope\">\r\n <el-select v-model=\"scope.row.htmlType\">\r\n <el-option label=\"文本框\" value=\"input\" />\r\n <el-option label=\"文本域\" value=\"textarea\" />\r\n <el-option label=\"下拉框\" value=\"select\" />\r\n <el-option label=\"单选框\" value=\"radio\" />\r\n <el-option label=\"复选框\" value=\"checkbox\" />\r\n <el-option label=\"日期控件\" value=\"datetime\" />\r\n <el-option label=\"图片上传\" value=\"imageUpload\" />\r\n <el-option label=\"文件上传\" value=\"fileUpload\" />\r\n <el-option label=\"富文本控件\" value=\"editor\" />\r\n <el-option label=\"hr\" value=\"hr\" />\r\n </el-select>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"字典类型\" min-width=\"12%\" align=\"center\">\r\n <template slot-scope=\"scope\">\r\n <el-select v-model=\"scope.row.dictType\" clearable filterable placeholder=\"请选择\">\r\n <el-option v-for=\"dict in dictOptions\" :key=\"dict.dictType\" :label=\"dict.dictName\" :value=\"dict.dictType\">\r\n <span style=\"float: left\">{{ dict.dictName }}</span>\r\n <span style=\"float: right; color: #8492a6; font-size: 13px\">{{ dict.dictType }}</span>\r\n </el-option>\r\n </el-select>\r\n </template>\r\n </el-table-column>\r\n </el-table>\r\n <!-- 添加或修改岗位对话框 -->\r\n <el-dialog :close-on-click-modal=\"false\" :title=\"title\" :visible.sync=\"openZd\" width=\"70vw\" append-to-body>\r\n <el-form ref=\"formZd\" :model=\"formZd\" :rules=\"rulesZd\" label-width=\"120px\">\r\n <el-row>\r\n <el-col :span=\"8\">\r\n <el-form-item label=\"字段名:\" prop=\"columnName\">\r\n <el-input :disabled=\"this.formZd.id\" v-model=\"formZd.columnName\" placeholder=\"请输入字段名\" />\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"8\">\r\n <el-form-item label=\"字段描述:\" prop=\"columnComment\">\r\n <el-input v-model=\"formZd.columnComment\" placeholder=\"请输入字段描述\" />\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"8\">\r\n <el-form-item label=\"物理类型:\" prop=\"columnType\">\r\n <el-input v-model=\"formZd.columnType\" placeholder=\"请输入物理类型\" />\r\n </el-form-item>\r\n </el-col>\r\n </el-row>\r\n <el-row>\r\n <el-col :span=\"8\">\r\n <el-form-item label=\"字段显示规则:\" prop=\"mask\">\r\n <el-input v-model=\"formZd.mask\" placeholder=\"请输入字段显示规则\" />\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"8\">\r\n <el-form-item label=\"排序:\" prop=\"sort\">\r\n <el-input-number style=\"width: 100%;\" v-model=\"formZd.sort\" placeholder=\"请输入排序\" />\r\n </el-form-item>\r\n </el-col>\n <el-col :span=\"8\">\n <el-form-item label=\"正则表达式:\" prop=\"regular\">\n <el-input v-model=\"formZd.regular\" placeholder=\"请输入正则表达式\" />\n </el-form-item>\n </el-col>\r\n </el-row>\r\n\r\n <el-row>\n <el-col :span=\"8\">\n <el-form-item label=\"外键(FK):\" prop=\"foreignKey\">\n <!-- <el-select style=\"width: 100%;\" filterable v-model=\"formZd.foreignKey\" placeholder=\"请选择外键(FK)\" clearable size=\"small\">\n <el-option v-for=\"dict in columList\" :key=\"dict.columnId\" :label=\"dict.columnName\" :value=\"dict.columnId\" />\n </el-select> -->\n <div style=\"cursor: pointer;\" @click=\"fkzdFn\">\n <el-input readonly style=\"width: 100%;\" clearable v-model=\"ForeName\" placeholder=\"请选择外键(FK)\" />\n </div>\n </el-form-item>\n </el-col>\r\n <el-col :span=\"8\">\r\n <el-form-item label=\"关联HR字段:\" prop=\"hrParentId\">\r\n <el-select style=\"width: 100%;\" v-model=\"formZd.hrParentId\" placeholder=\"请选择关联HR字段\" clearable>\r\n <el-option v-for=\"dict in columHRList\" :key=\"dict.id\" :label=\"dict.columnName\" :value=\"dict.id\" />\r\n </el-select>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"8\">\r\n <el-form-item label=\"缺省值:\" prop=\"defaultValue\">\r\n <el-input v-model=\"formZd.defaultValue\" placeholder=\"请输入缺省值\" />\r\n </el-form-item>\r\n </el-col>\r\n </el-row>\r\n <el-row>\n <el-col :span=\"8\">\n <el-form-item label=\"行数:\" prop=\"numRows\">\n <el-input-number style=\"width: 100%;\" v-model=\"formZd.numRows\" placeholder=\"请输入行数\" />\n </el-form-item>\n </el-col>\r\n <el-col :span=\"8\">\r\n <el-form-item label=\"列数:\" prop=\"numColumns\">\r\n <el-input-number style=\"width: 100%;\" v-model=\"formZd.numColumns\" placeholder=\"请输入列数\" />\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"8\">\r\n <el-form-item label=\"字段翻译器:\" prop=\"fieldTranslator\">\r\n <el-input v-model=\"formZd.fieldTranslator\" placeholder=\"请输入字段翻译器\" />\r\n </el-form-item>\r\n </el-col>\r\n </el-row>\r\n <el-row>\n <el-col :span=\"8\">\n <el-form-item label=\"扩展属性:\" prop=\"extendedAttributes\">\n <el-input v-model=\"formZd.extendedAttributes\" placeholder=\"请输入扩展属性\" />\n </el-form-item>\n </el-col>\r\n <el-col :span=\"8\">\r\n <el-form-item label=\"查询方式:\" prop=\"queryType\">\r\n <el-select style=\"width: 100%;\" v-model=\"formZd.queryType\">\r\n <el-option label=\"=\" value=\"EQ\" />\r\n <el-option label=\"!=\" value=\"NE\" />\r\n <el-option label=\">\" value=\"GT\" />\r\n <el-option label=\">=\" value=\"GTE\" />\r\n <el-option label=\"<\" value=\"LT\" />\r\n <el-option label=\"<=\" value=\"LTE\" />\r\n <el-option label=\"LIKE\" value=\"LIKE\" />\r\n <el-option label=\"BETWEEN\" value=\"BETWEEN\" />\r\n </el-select>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"8\">\r\n <el-form-item label=\"显示类型:\" prop=\"htmlType\">\r\n <el-select style=\"width: 100%;\" v-model=\"formZd.htmlType\">\r\n <el-option label=\"文本框\" value=\"input\" />\r\n <el-option label=\"文本域\" value=\"textarea\" />\r\n <el-option label=\"下拉框\" value=\"select\" />\r\n <el-option label=\"单选框\" value=\"radio\" />\r\n <el-option label=\"复选框\" value=\"checkbox\" />\r\n <el-option label=\"日期控件\" value=\"datetime\" />\r\n <el-option label=\"图片上传\" value=\"imageUpload\" />\r\n <el-option label=\"文件上传\" value=\"fileUpload\" />\r\n <el-option label=\"富文本控件\" value=\"editor\" />\r\n <el-option label=\"hr\" value=\"hr\" />\r\n </el-select>\r\n </el-form-item>\r\n </el-col>\r\n </el-row>\r\n <el-row>\n <el-col :span=\"8\">\n <el-form-item label=\"字典类型:\" prop=\"dictType\">\n <template slot-scope=\"scope\">\n <el-select style=\"width: 100%;\" v-model=\"formZd.dictType\" clearable filterable placeholder=\"请选择\">\n <el-option v-for=\"dict in dictOptions\" :key=\"dict.dictType\" :label=\"dict.dictName\" :value=\"dict.dictType\">\n <span style=\"float: left\">{{ dict.dictName }}</span>\n <span style=\"float: right; color: #8492a6; font-size: 13px\">{{ dict.dictType }}</span>\n </el-option>\n </el-select>\n </template>\n </el-form-item>\n </el-col>\r\n <el-col :span=\"8\">\r\n <el-form-item label=\"显示字段\" prop=\"isOut\">\r\n <el-checkbox true-label=\"Y\" false-label=\"N\" v-model=\"formZd.isOut\"></el-checkbox>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"8\">\r\n <el-form-item label=\"输入字段\" prop=\"isIn\">\r\n <el-checkbox true-label=\"Y\" false-label=\"N\" v-model=\"formZd.isIn\"></el-checkbox>\r\n </el-form-item>\r\n </el-col>\r\n </el-row>\r\n <el-row>\n <el-col :span=\"8\">\n <el-form-item label=\"查询条件\" prop=\"isQuery\">\n <el-checkbox true-label=\"1\" false-label=\"0\" v-model=\"formZd.isQuery\"></el-checkbox>\n </el-form-item>\n </el-col>\r\n <el-col :span=\"8\">\r\n <el-form-item label=\"必填\" prop=\"isRequired\">\r\n <el-checkbox true-label=\"1\" false-label=\"0\" v-model=\"formZd.isRequired\"></el-checkbox>\r\n </el-form-item>\r\n </el-col>\r\n </el-row>\r\n </el-form>\r\n <div slot=\"footer\" class=\"dialog-footer\">\r\n <el-button type=\"primary\" @click=\"submitFormZd\">确 定</el-button>\r\n <el-button @click=\"cancel\">取 消</el-button>\r\n </div>\r\n </el-dialog>\r\n </el-tab-pane>\r\n <!-- <el-tab-pane label=\"生成信息\" name=\"genInfo\">\r\n <gen-info-form ref=\"genInfo\" :info=\"info\" :tables=\"tables\" :menus=\"menus\"/>\r\n </el-tab-pane> -->\r\n <el-tab-pane label=\"关联表\" name=\"genInfo\">\r\n <el-row style=\"margin-bottom: 20px;\" type=\"flex\" :gutter=\"10\" justify=\"end\">\r\n <el-col :span=\"1.5\">\r\n <el-button @click=\"handleAdd_gl\" icon=\"el-icon-plus\" size=\"mini\" style=\"background-color: #FFE9ED;color: #E58481;border: 1px solid #E58481;\">新增</el-button>\r\n </el-col>\r\n <el-col :span=\"1.5\">\r\n <el-button icon=\"el-icon-delete\" @click=\"handleDel_gl\" size=\"mini\" style=\"background-color: #FFD6B0;color: #EA551A;border: 1px solid #F4AD6B;\"\r\n :disabled=\"multiple1\">删除</el-button>\r\n </el-col>\r\n </el-row>\r\n <el-table ref=\"dragTable\" @row-dblclick=\"dbSelected\" v-loading=\"loading\" :data=\"postList\" row-key=\"columnId\"\r\n align=\"center\" :max-height=\"tableHeight\" @selection-change=\"handleSelectionChange1\">\r\n <el-table-column type=\"selection\" width=\"55\" align=\"center\" />\r\n <el-table-column label=\"id\" width=\"60\" align=\"center\" prop=\"id\" />\r\n <el-table-column label=\"可用\" align=\"center\" prop=\"isDel\">\r\n <template slot-scope=\"scope\">\r\n <el-checkbox true-label=\"Y\" disabled false-label=\"N\" v-model=\"scope.row.isDel\"></el-checkbox>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"序号\" align=\"center\" prop=\"sort\" />\r\n <el-table-column label=\"描述\" align=\"center\" prop=\"description\" />\r\n <el-table-column label=\"关联表\" align=\"center\" prop=\"tableName\" />\r\n <el-table-column label=\"字段(关联到主表PK)\" width=\"160px\" align=\"center\" prop=\"columnName\" />\r\n <el-table-column label=\"显示条件\" align=\"center\" prop=\"displayConditions\" />\r\n <el-table-column label=\"关联方式\" align=\"center\" prop=\"relationType\">\r\n <template slot-scope=\"scope\">\r\n {{scope.row.relationType | relationTypeFn}}\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"内嵌编辑\" align=\"center\" prop=\"embedEdit\">\r\n <template slot-scope=\"scope\">\r\n {{scope.row.embedEdit | embedEditFn}}\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"修改人\" align=\"center\" prop=\"updateBy\" />\r\n <el-table-column label=\"修改时间\" align=\"center\" prop=\"updateTime\" />\r\n </el-table>\r\n <pagination v-show=\"total>0\" :total=\"total\" :page.sync=\"queryParams.pageNum\" :limit.sync=\"queryParams.pageSize\"\r\n @pagination=\"tabList\" />\r\n </el-tab-pane>\r\n <el-tab-pane label=\"数据库SQL\" name=\"genSql\">\r\n <el-row type=\"flex\" justify=\"end\">\r\n <el-button @click=\"zxCreaBtn\" size=\"mini\" style=\"background-color: #FFE9ED;color: #E58481;border: 1px solid #E58481;\">执行创建语句</el-button>\r\n <el-button @click=\"sxCreaBtn\" size=\"mini\" style=\"background-color: #FFD6B0;color: #EA551A;border: 1px solid #F4AD6B;\">刷新创建语句</el-button>\r\n </el-row>\r\n <el-form>\r\n <el-form-item label=\"创建语句:\" style=\"margin-top: 20px;\">\r\n <el-input class=\"resizeNone\" v-model=\"tableSqlData.createSql\" type=\"textarea\" />\r\n </el-form-item>\r\n <el-form-item label=\"修改日志:\">\r\n <el-input class=\"resizeNone\" v-model=\"tableSqlData.createLog\" type=\"textarea\" />\r\n </el-form-item>\r\n </el-form>\r\n </el-tab-pane>\r\n </el-tabs>\r\n <!-- 添加或修改岗位对话框 -->\r\n <el-dialog :close-on-click-modal=\"false\" :title=\"title\" :visible.sync=\"open\" width=\"500px\" append-to-body>\r\n <el-form ref=\"form\" :model=\"form\" :rules=\"rules\" label-width=\"100px\">\r\n <el-form-item label=\"描述:\" prop=\"postName\">\r\n <el-input v-model=\"form.description\" placeholder=\"请输入描述\" />\r\n </el-form-item>\r\n <el-form-item label=\"关联表:\" prop=\"relationParentId\">\r\n <el-select style=\"width: 100%;\" v-model=\"form.relationParentId\" placeholder=\"请选择关联表\" @change=\"relationFn\"\r\n v-loadmore=\"loadMore\">\r\n <el-option v-for=\"item in tableList.rows\" :key=\"item.tableId\" :label=\"item.tableComment\" :value=\"item.tableId\">\r\n </el-option>\r\n </el-select>\r\n </el-form-item>\r\n <el-form-item label=\"字段:\" prop=\"relationChildId\">\r\n <el-select style=\"width: 100%;\" v-model=\"form.relationChildId\" placeholder=\"请选择字段\" v-loadmore=\"loadMore\">\r\n <el-option v-for=\"item in genList\" v-if=\"item.foreignKey\" :key=\"item.columnId\" :label=\"item.columnName\" :value=\"item.columnId\">\r\n </el-option>\r\n </el-select>\r\n </el-form-item>\r\n <el-form-item label=\"显示条件:\" prop=\"displayConditions\">\r\n <el-input v-model=\"form.displayConditions\" controls-position=\"right\" placeholder=\"请输入显示条件\" />\r\n </el-form-item>\r\n <el-form-item label=\"关联方式:\" prop=\"relationType\">\r\n <el-select style=\"width: 100%;\" v-model=\"form.relationType\" placeholder=\"请选择关联方式\" clearable size=\"small\">\r\n <el-option v-for=\"dict in relationType\" :key=\"dict.dictValue\" :label=\"dict.dictLabel\" :value=\"dict.dictValue\" />\r\n </el-select>\r\n </el-form-item>\r\n <el-form-item label=\"内嵌编辑:\" prop=\"embedEdit\">\r\n <el-select style=\"width: 100%;\" v-model=\"form.embedEdit\" placeholder=\"岗位状态\" clearable size=\"small\">\r\n <el-option v-for=\"dict in embedEdit\" :key=\"dict.dictValue\" :label=\"dict.dictLabel\" :value=\"dict.dictValue\" />\r\n </el-select>\r\n </el-form-item>\r\n <el-form-item label=\"序号:\" prop=\"sort\">\r\n <el-input-number style=\"width: 100%;\" v-model=\"form.sort\" controls-position=\"right\" :min=\"0\" />\r\n </el-form-item>\r\n <el-form-item label=\"是否可用:\" prop=\"isDel\">\r\n <el-checkbox true-label=\"Y\" false-label=\"N\" v-model=\"form.isDel\"></el-checkbox>\r\n </el-form-item>\r\n </el-form>\r\n <div slot=\"footer\" class=\"dialog-footer\">\r\n <el-button type=\"primary\" @click=\"addGlfn\">确 定</el-button>\r\n <el-button @click=\"cancel\">取 消</el-button>\r\n </div>\r\n </el-dialog>\r\n <!-- 快速搜索对话框 -->\r\n <el-dialog :close-on-click-modal=\"false\" :title=\"titleopenquery\" :visible.sync=\"openquery\" width=\"1200px\" append-to-body>\r\n <el-form ref=\"formquery\" @row-dblclick=\"dbSelectedZd\" :model=\"formquery\" :rules=\"rules\" label-width=\"100px\">\r\n <dynamic-forms :ref=\"item.columnName\" :config=\"formquery.fixedData\" @inputs = \"changeFn\" :formConfig=\"item\" v-for=\"(item,index) in queryData.queryList\" :key='index' />\r\n <el-form-item style=\"display: inline-block;\">\r\n <el-button type=\"primary\" @click=\"handleQuery\">搜索</el-button>\r\n <el-button @click=\"openquery = false\">取消</el-button>\r\n </el-form-item>\r\n </el-form>\r\n <el-table stripe @row-dblclick=\"tableBtn\" :data=\"postListquery.rows\" @selection-change=\"handleSelectionChange\">\r\n <el-table-column :label=\"item.columnComment\" align=\"center\" :prop=\"item.columnName\" v-for=\"(item,index) in postListquery.tableHeadList\" :key=\"index\" />\r\n </el-table>\r\n <pagination\r\n v-show=\"totalquery>0\"\r\n :total=\"totalquery\"\r\n :page.sync=\"aliemg.pageNo\"\r\n :limit.sync=\"aliemg.pageSize\"\r\n @pagination=\"getLisail\"\r\n />\r\n </el-dialog>\r\n </el-card>\r\n</template>\r\n<script>\r\n import {\r\n getGenTable,\r\n updateGenTable,\r\n delPost,\r\n tabList,\r\n listTable,\r\n addGenTable,\r\n setGenTable,\r\n delGenTable,\r\n listAllColumnsByTableId,\r\n genTableColumnList,\r\n tableSql,\r\n zxImplement,\r\n getReload,\r\n addGenTableColumn,\r\n delGenTableColumn,\r\n setGenTableColumn,\r\n getGenTableColumn,\r\n getByIdWithForeignKey,\r\n listIndexfou,\r\n tableQuery,\r\n qurGenTable\r\n } from \"@/api/tool/gen\";\r\n import {\r\n optionselect as getDictOptionselect\r\n } from \"@/api/system/dict/type\";\r\n import {\r\n listMenu as getMenuTreeselect\r\n } from \"@/api/system/menu\";\r\n import basicInfoForm from \"./basicInfoForm\";\r\n import genInfoForm from \"./genInfoForm\";\r\n import Sortable from 'sortablejs'\r\n\r\n let _this = ''\r\n export default {\r\n name: \"GenEdit\",\r\n components: {\r\n basicInfoForm,\r\n genInfoForm\r\n },\r\n data() {\r\n _this = this\r\n return {\r\n ForeName: '',\r\n totalquery:0,\r\n // 多行查询\r\n titleopenquery:'快速查询',\r\n // 获取输入框的参数\r\n queryLisr:{\r\n table:'gen_table_column'\r\n },\r\n aliemg:{\r\n table:'gen_table_column',\r\n orderBy:'create_time desc',\r\n pageNo:1,\r\n pageSize:10,\r\n fixedData:{\r\n condition:''\r\n }\r\n },\r\n postListquery:{},\r\n queryData: {},\r\n openquery:false,\r\n formquery:{},\r\n // 字段信息\r\n tableSqlData: [],\r\n columList: [],\r\n columHRList: [],\r\n foreignKey: [],\r\n openZd: false,\r\n formZd: {\r\n },\r\n rulesZd: {\r\n columnName: [{\r\n required: true,\r\n message: \"请输入字段名\",\r\n trigger: \"blur\"\r\n }],\r\n columnComment: [{\r\n required: true,\r\n message: \"请输入字段描述\",\r\n trigger: \"blur\"\r\n }],\n columnType: [{\r\n required: true,\r\n message: \"请输入物理类型\",\r\n trigger: \"blur\"\r\n }],\r\n mask: [{\r\n required: true,\r\n message: \"请输入字段显示规则\",\r\n trigger: \"blur\"\r\n }],\r\n sort: [{\r\n required: true,\r\n message: \"请输入序号\",\r\n trigger: \"blur\"\r\n }],\r\n },\r\n loadingZd: '',\r\n // 关联表\r\n title: \"\",\r\n loading: false,\r\n open: false,\r\n form: {},\r\n rules: {\r\n relationParentId: [{\r\n required: true,\r\n message: \"请选择关联表\",\r\n trigger: \"blur\"\r\n }],\r\n relationChildId: [{\r\n required: true,\r\n message: \"请选择字段\",\r\n trigger: \"blur\"\r\n }],\r\n relationType: [{\r\n required: true,\r\n message: \"请选择关联条件\",\r\n trigger: \"blur\"\r\n }],\r\n },\r\n postList: [],\r\n total: 1,\r\n tableList: {},\r\n // 关联方式\r\n\r\n // 内嵌编辑\r\n genList: [],\r\n glbParams: {\r\n pageNum: 1,\r\n pageSize: 10,\r\n },\r\n // 关联表查询参数\r\n queryParams: {\r\n relationParentId: this.$route.params && this.$route.params.tableId,\r\n pageNum: 1,\r\n pageSize: 10,\r\n },\r\n // 选中选项卡的 name\r\n activeName: \"basic\",\r\n // 表格的高度\r\n tableHeight: document.documentElement.scrollHeight - 245 + \"px\",\r\n // 表信息\r\n tables: [],\r\n // 表列信息\r\n cloumns: [],\r\n // 字典信息\r\n dictOptions: [],\r\n // 菜单信息\r\n menus: [],\r\n // 表详细信息\r\n info: {},\r\n // 选中数组\r\n ids: [],\r\n ids1: [],\r\n // 非单个禁用\r\n single: true,\r\n single1: true,\r\n // 非多个禁用\r\n multiple: true,\r\n multiple1: true,\r\n // 关联方式\r\n relationType: [],\r\n // 内嵌编辑\r\n embedEdit: [],\r\n };\r\n },\r\n filters: {\r\n zdFn(data) {\r\n let is = ''\r\n for (let item of _this.columList) {\r\n if (item.columnId == data) {\r\n is = item.columnName\r\n }\r\n }\r\n return is\r\n },\r\n relationTypeFn(data) {\r\n let is = ''\r\n for (let item of _this.relationType) {\r\n if (item.dictValue == data) {\r\n is = item.dictLabel\r\n }\r\n }\r\n return is\r\n },\r\n embedEditFn(data) {\r\n let is = ''\r\n for (let item of _this.embedEdit) {\r\n if (item.dictValue == data) {\r\n is = item.dictLabel\r\n }\r\n }\r\n return is\r\n },\r\n },\r\n created() {\r\n const tableId = this.$route.params && this.$route.params.tableId;\r\n if (tableId) {\r\n // 获取表详细信息\r\n getGenTable(tableId).then(res => {\r\n this.cloumns = res.data.rows;\r\n this.info = res.data.info;\n console.log(this.info,33456)\r\n this.tables = res.data.tables;\r\n });\r\n //查询数据库sql\r\n tableSql(tableId).then(res => {\r\n if (res.data) {\r\n this.tableSqlData = res.data\r\n }\r\n })\r\n /** 查询字典下拉列表 */\r\n getDictOptionselect().then(response => {\r\n this.dictOptions = response.data;\r\n });\r\n // 关联HR字段\r\n genTableColumnList({\r\n tableId,\r\n htmlType: 'HR'\r\n }).then(response => {\r\n this.columHRList = response.rows;\r\n });\r\n // 关联字段\r\n listAllColumnsByTableId({\r\n id:tableId\r\n }).then(response => {\n console.log(response.data,9999888)\r\n this.columList = response.data;\r\n });\r\n // 关联表数据\r\n listTable(this.glbParams).then(response => {\r\n this.tableList = response;\r\n });\r\n /** 查询菜单下拉列表 */\r\n // getMenuTreeselect().then(response => {\r\n // this.menus = this.handleTree(response.data, \"menuId\");\r\n // });\r\n // 关联方式\r\n this.getDicts(\"relation_type\").then(response => {\r\n this.relationType = response.data;\r\n });\r\n // 内嵌编辑\r\n this.getDicts(\"embed_edit\").then(response => {\r\n this.embedEdit = response.data;\r\n });\r\n }\r\n this.tabList()\r\n\r\n },\r\n methods: {\r\n tableBtn(row){\r\n this.openquery = false\r\n this.ForeName = row.column_name\r\n this.formZd.foreignKey = row.column_id\r\n },\r\n fkzdFn() {\r\n this.queryedit()\r\n this.getLisail()\r\n this.openquery = true\r\n },\r\n changeFn(obj) {\r\n console.log(obj)\r\n for(let key in obj){\r\n this.formquery.fixedData[key] = obj[key]\r\n }\r\n },\r\n // 快速查询\r\n queryedit(){\r\n this.loading = true;\r\n tableQuery(this.queryLisr).then(response => {\r\n let data = response.data\r\n this.queryData = data\r\n this.loading = false;\r\n })\r\n },\r\n handleQuery(){\r\n for(let item of this.queryData.queryList){\r\n if(item.htmlType == 'checkbox' || item.htmlType == 'imageUpload' || item.htmlType == 'fileUpload'){\r\n this.formquery[item.columnName] = this.$refs[item.columnName][0].config\r\n } else{\r\n this.formquery[item.columnName] = this.$refs[item.columnName][0].config[item.columnName]\r\n }\r\n }\r\n this.aliemg.fixedData.condition = this.formquery\r\n this.getLisail()\r\n },\r\n // 快速查询列表\r\n getLisail() {\r\n this.loading = true;\r\n listIndexfou(this.aliemg).then(response => {\r\n if(response.data){\r\n // this.tableDataalid = response.data.tableHeadList;\r\n this.postListquery = response.data\r\n this.postListquery.rows.filter(route => {\r\n if(route.table_id){\r\n route.table_id = route.table_id.name\r\n }\r\n })\n this.totalquery = response.data.total;\r\n }\r\n this.loading = false;\r\n }\r\n );\r\n },\r\n submitFormZd() {\r\n this.$refs[\"formZd\"].validate(valid => {\r\n if (valid) {\r\n const tableId = this.$route.params && this.$route.params.tableId;\r\n this.formZd.tableId = tableId\r\n if (this.formZd.id != undefined) {\r\n setGenTableColumn(this.formZd).then(response => {\r\n this.msgSuccess(\"修改成功\");\r\n this.openZd = false;\r\n // 获取表详细信息\r\n getGenTable(tableId).then(res => {\r\n this.cloumns = res.data.rows;\r\n this.info = res.data.info;\r\n this.tables = res.data.tables;\r\n });\r\n });\r\n } else {\r\n addGenTableColumn(this.formZd).then(response => {\r\n this.msgSuccess(\"新增成功\");\r\n this.openZd = false;\r\n // 获取表详细信息\r\n getGenTable(tableId).then(res => {\r\n this.cloumns = res.data.rows;\r\n this.info = res.data.info;\r\n this.tables = res.data.tables;\r\n });\r\n });\r\n }\r\n\r\n }\r\n });\r\n },\r\n sxCreaBtn() {\r\n const tableId = this.$route.params && this.$route.params.tableId\r\n getReload({\r\n tableId,\r\n createSql: this.tableSqlData.createSql,\r\n createLog: this.tableSqlData.createLog,\r\n id: this.tableSqlData.id\r\n }).then(res => {\r\n this.msgSuccess('刷新成功')\r\n //查询数据库sql\r\n tableSql(tableId).then(res => {\r\n if (res.data) {\r\n this.tableSqlData = res.data\r\n }\r\n })\r\n })\r\n },\r\n zxCreaBtn() {\r\n const _this = this\r\n this.$confirm('是否确认执行创建语句?', \"警告\", {\r\n confirmButtonText: \"确定\",\r\n cancelButtonText: \"取消\",\r\n type: \"warning\"\r\n }).then(function() {\r\n return zxImplement({\r\n tableId: _this.$route.params && _this.$route.params.tableId,\r\n createSql: _this.tableSqlData.createSql,\r\n createLog: _this.tableSqlData.createLog,\r\n id: _this.tableSqlData.id\r\n })\r\n }).then(res => {\r\n _this.msgSuccess('执行成功')\r\n })\r\n },\r\n dbSelectedZd(row) {\r\n this.reset();\r\n const id = row.id\r\n getByIdWithForeignKey(id).then(response => {\r\n let data = response.data\r\n data.foreignKey = data.foreignKey ? data.foreignKey - 0 : ''\r\n this.formZd = data;\n if(data.fkInfo){\n this.ForeName = data.fkInfo.value\n }\r\n this.openZd = true;\n this.title = \"修改字段信息\";\r\n });\r\n },\r\n dbSelected(row) {\r\n this.reset();\r\n const id = row.id\r\n qurGenTable(id).then(response => {\r\n let data = response.data\r\n data.relationType = data.relationType + \"\"\r\n data.embedEdit = data.embedEdit?(data.embedEdit + \"\"): data.embedEdit\n getGenTable(data.relationParentId).then(res => {\r\n this.genList = res.data.rows;\r\n this.form = data;\r\n this.open = true;\r\n this.title = \"修改关联表\";\r\n });\r\n });\r\n },\r\n addGlfn() {\r\n this.$refs[\"form\"].validate(valid => {\r\n if (valid) {\n let datas = JSON.parse(JSON.stringify(this.form))\n datas.relationParentId = this.info.tableId\r\n if (this.form.id != undefined) {\n setGenTable(datas).then(response => {\r\n this.msgSuccess(\"修改成功\");\r\n this.open = false;\r\n this.tabList();\r\n });\r\n } else {\r\n addGenTable(datas).then(response => {\r\n this.msgSuccess(\"新增成功\");\r\n this.open = false;\r\n this.tabList();\r\n });\r\n }\r\n }\r\n });\r\n },\r\n relationFn(data) {\r\n getGenTable(data).then(res => {\r\n this.genList = res.data.rows;\r\n });\r\n },\r\n loadMore() {\r\n const _this = this\r\n let num = _this.tableList.total % 10 == 0 ? _this.tableList.total / 10 : ((_this.tableList.total - _this.tableList\r\n .total % 10) / 10 + 1)\r\n console.log(num, 1)\r\n if (this.glbParams.pageNum < num) {\r\n this.glbParams.pageNum++\r\n // 关联表数据\r\n listTable(this.glbParams).then(response => {\r\n let data = response\r\n data.rows = _this.tableList.rows.concat(data.rows)\r\n _this.tableList = data;\r\n });\r\n }\r\n },\r\n // 取消按钮\r\n cancel() {\r\n this.open = false;\r\n this.reset();\r\n this.openZd = false;\n this.resetZd();\r\n },\r\n // 关联表数据\r\n tabList() {\r\n this.loading = true;\r\n tabList(this.queryParams).then(response => {\r\n this.postList = response.rows;\r\n this.total = response.total;\r\n this.loading = false;\r\n });\r\n },\r\n /** 新增按钮操作 */\r\n handleAdd_gl() {\r\n this.reset();\r\n this.open = true;\n console.log(this.form)\n\r\n this.title = \"新增关联表\";\r\n },\r\n handleDel_gl(row) {\r\n const ids = row.id || this.ids1;\r\n this.$confirm('是否确认删除id为\"' + ids + '\"的数据项?', \"警告\", {\r\n confirmButtonText: \"确定\",\r\n cancelButtonText: \"取消\",\r\n type: \"warning\"\r\n }).then(function() {\r\n return delGenTable(ids);\r\n }).then(() => {\r\n this.tabList();\r\n this.msgSuccess(\"删除成功\");\r\n })\r\n },\r\n // 表单重置\r\n reset() {\r\n this.form = {\r\n isDel: 'N'\r\n };\r\n this.resetForm(\"form\");\r\n },\r\n resetZd() {\r\n this.formZd = {\r\n };\r\n this.resetForm(\"formZd\");\r\n },\r\n /** 提交按钮 */\r\n submitForm() {\r\n let isInFlag = 0\r\n let isOutFlag = 0\n\n for(let item of this.cloumns){\r\n if(item.isIn=='Y'){\r\n isInFlag++\r\n }\r\n if(item.isOut=='Y'){\r\n isOutFlag++\r\n }\r\n }\r\n if(isInFlag>1){\r\n this.msgError('\"输入字段\"最多只能选择一个!')\r\n return\r\n }\r\n if(isOutFlag>1){\r\n this.msgError('\"显示字段\"最多只能选择一个!')\r\n return\r\n }\r\n const basicForm = this.$refs.basicInfo.$refs.basicInfoForm;\n\r\n // const genForm = this.$refs.genInfo.$refs.genInfoForm;\r\n Promise.all([basicForm].map(this.getFormPromise)).then(res => {\r\n const validateResult = res.every(item => !!item);\r\n if (validateResult) {\r\n const genTable = Object.assign({}, basicForm.model);\r\n genTable.columns = this.cloumns;\r\n // genTable.params = {\r\n // treeCode: genTable.treeCode,\r\n // treeName: genTable.treeName,\r\n // treeParentCode: genTable.treeParentCode,\r\n // parentMenuId: genTable.parentMenuId\r\n // };\n console.log(genTable)\n if(this.activeName=='basic'){\n genTable.updateType ='1'\n }\n if(this.activeName=='cloum'){\n genTable.updateType ='2'\n }\r\n updateGenTable(genTable).then(res => {\r\n this.msgSuccess(res.msg);\r\n if (res.code === 200) {\r\n this.close();\r\n }\r\n });\r\n } else {\r\n this.msgError(\"表单校验未通过,请重新检查提交内容\");\r\n }\r\n });\r\n },\r\n getFormPromise(form) {\r\n return new Promise(resolve => {\r\n form.validate(res => {\r\n resolve(res);\r\n });\r\n });\r\n },\r\n /** 关闭按钮 */\r\n close() {\r\n this.$store.dispatch(\"tagsView/delView\", this.$route);\r\n this.$router.push({\r\n path: \"/tool/gen\",\r\n query: {\r\n t: Date.now()\r\n }\r\n })\r\n },\r\n // 多选框选中数据\r\n handleSelectionChange(selection) {\r\n this.ids = selection.map(item => item.id)\r\n this.single = selection.length != 1\r\n this.multiple = !selection.length\r\n },\r\n // 多选框选中数据\r\n handleSelectionChange1(selection) {\r\n this.ids1 = selection.map(item => item.id)\r\n this.single1 = selection.length != 1\r\n this.multiple1 = !selection.length\r\n },\r\n /** 删除按钮操作 */\r\n handleDelete(row) {\r\n const ids = row.id || this.ids;\r\n const tableId = this.$route.params && this.$route.params.tableId;\r\n this.$confirm('是否确认删除字段编号为\"' + ids + '\"的数据项?', \"警告\", {\r\n confirmButtonText: \"确定\",\r\n cancelButtonText: \"取消\",\r\n type: \"warning\"\r\n }).then(function() {\r\n return delGenTableColumn(ids);\r\n }).then(() => {\r\n // 获取表详细信息\r\n getGenTable(tableId).then(res => {\r\n this.cloumns = res.data.rows;\r\n this.info = res.data.info;\r\n this.tables = res.data.tables;\r\n });\r\n this.msgSuccess(\"删除成功\");\r\n })\r\n },\r\n handleAdd() {\r\n this.resetZd();\n this.openZd = true;\r\n this.title = \"新增字段信息\";\r\n }\r\n },\r\n mounted() {\r\n const el = this.$refs.dragTable.$el.querySelectorAll(\".el-table__body-wrapper > table > tbody\")[0];\r\n const sortable = Sortable.create(el, {\r\n handle: \".allowDrag\",\r\n onEnd: evt => {\r\n const targetRow = this.cloumns.splice(evt.oldIndex, 1)[0];\r\n this.cloumns.splice(evt.newIndex, 0, targetRow);\r\n for (let index in this.cloumns) {\r\n this.cloumns[index].sort = parseInt(index) + 1;\r\n }\r\n }\r\n });\r\n }\r\n };\r\n</script>\r\n<style lang=\"scss\">\r\n .pagination-container {\r\n height: 35px;\r\n }\r\n\r\n .resizeNone {\r\n width: 60vw;\r\n border-radius: 3px;\r\n\r\n .el-textarea__inner {\r\n //el_input中的隐藏属性\r\n resize: none; //主要是这个样式\r\n height: 200px;\r\n }\r\n }\r\n</style>\r\n"]}]}
|