|
@@ -471,8 +471,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { listTable, removeTableList } from "@/api/dragform/tableList";
|
|
|
-import { getFormName, getListName, dragTablePreview, } from "@/api/dragform/form.js";
|
|
|
+import { getFormName, getListName, } from "@/api/dragform/form.js";
|
|
|
import { delMenu } from "@/api/system/menu";
|
|
|
import { getMenuList, addMenu, getRouters} from "@/api/menu.js";
|
|
|
import { getParticMenu, updateMenu } from "@/api/system/menu.js";
|
|
@@ -481,7 +480,6 @@ import { mapGetters, mapState } from "vuex";
|
|
|
import { v4 as uuidv4 } from "uuid";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
-import json from "highlight.js/lib/languages/json";
|
|
|
import { getTableInfo } from "@/api/system/table.js";
|
|
|
|
|
|
export default {
|
|
@@ -490,10 +488,11 @@ export default {
|
|
|
dicts: ["sys_time_format", "table_statistic_type"],
|
|
|
data() {
|
|
|
return {
|
|
|
+ // 输入框验证规则
|
|
|
isInputInvalid: false,
|
|
|
-
|
|
|
// 包含查询依赖字段dialog
|
|
|
isSearchDialog: false,
|
|
|
+ // 选择依赖条件
|
|
|
isSearchIndex: null,
|
|
|
// 依赖方式
|
|
|
relyOption: null,
|
|
@@ -610,9 +609,6 @@ export default {
|
|
|
tableName: "", // 当前表名称
|
|
|
selectFields: '', //关联字段
|
|
|
relateTitle: true,
|
|
|
- relateTableName: "", //关联表名称
|
|
|
- relateFields: "", //子集关联字段
|
|
|
- relateFieldList: [], //子集关联字段数据
|
|
|
groupTitle: true,
|
|
|
tableItemForm: {
|
|
|
tId: "",
|
|
@@ -644,13 +640,6 @@ export default {
|
|
|
await this.getMenuList();
|
|
|
},
|
|
|
computed: {
|
|
|
- selectRelate(){
|
|
|
- if(this.tableItemForm.tableName =='') return
|
|
|
- return this.tableList.filter(item => item.tableName !== this.tableItemForm.tableName)
|
|
|
- },
|
|
|
- dataArr() {
|
|
|
- return this.tableFieldList.filter((item) => item.isShow);
|
|
|
- },
|
|
|
...mapGetters(["addRoutes"]),
|
|
|
...mapState({
|
|
|
databaseName: (state) => state.user.dataSource.databaseName,
|
|
@@ -683,9 +672,11 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 解决回显数据输入框不能输入问题
|
|
|
iptChange(){
|
|
|
this.$forceUpdate(); //强制刷新
|
|
|
},
|
|
|
+ // 表格列表
|
|
|
async getTableList(){
|
|
|
let res = await listGroup(this.queryParams);
|
|
|
this.total = res.total;
|
|
@@ -719,6 +710,7 @@ export default {
|
|
|
this.isSearchDialog = false
|
|
|
this.tableFieldList[this.serachIndex].isSearch = false
|
|
|
},
|
|
|
+ // 是否包含查询开关
|
|
|
isSearchBtn(){
|
|
|
if(this.relyOption == 0){
|
|
|
this.conditionDefault[this.isSearchIndex] = this.conditionDefaultValueMap
|
|
@@ -1213,7 +1205,7 @@ export default {
|
|
|
// 修改表格回显数据
|
|
|
async initTableData(tId) {
|
|
|
let res = await getTableInfo(tId);
|
|
|
- console.log('回显数据', res);
|
|
|
+ // console.log('回显数据', res);
|
|
|
if (res.code == 200) {
|
|
|
if (!this.formData.routePath) {
|
|
|
this.$message.warning("该表格菜单路由已经删除,请重新配置");
|
|
@@ -1230,7 +1222,6 @@ export default {
|
|
|
},
|
|
|
// 新增动态表格组
|
|
|
addTableGroup(formName){
|
|
|
-
|
|
|
this.$refs[formName].validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
// console.log('groupList', this.groupList);
|
|
@@ -1261,6 +1252,7 @@ export default {
|
|
|
};
|
|
|
let result;
|
|
|
|
|
|
+ // 新增菜单
|
|
|
result = await addMenu(payLoad);
|
|
|
|
|
|
if(result.code == 200){
|
|
@@ -1292,7 +1284,7 @@ export default {
|
|
|
|
|
|
// 添加表格组
|
|
|
let res = await addGroup(data)
|
|
|
- console.log(res);
|
|
|
+ // console.log(res);
|
|
|
if(res.code == 200){
|
|
|
this.$message.success("创建成功");
|
|
|
|
|
@@ -1314,10 +1306,7 @@ export default {
|
|
|
id: this.groupId
|
|
|
}
|
|
|
this.addDragData.forEach((item, index) => {
|
|
|
- // item.sqlKey = tableKeyObj.tableKey
|
|
|
let echo = JSON.parse(item.echoData)
|
|
|
- // echo.formData = this.groupForm
|
|
|
- // console.log(echo);
|
|
|
item.echoData = JSON.stringify(echo)
|
|
|
data.groupTableInfo.push({
|
|
|
tableKey: item.tableKey,
|
|
@@ -1330,7 +1319,7 @@ export default {
|
|
|
data.groupDescription = this.groupForm.groupDescription
|
|
|
data.groupTableInfo = JSON.stringify(data.groupTableInfo)
|
|
|
data.dragTables = this.addDragData
|
|
|
- console.log(data);
|
|
|
+ // console.log(data);
|
|
|
let res = await updataGroup(data)
|
|
|
|
|
|
if(res.code == 200){
|
|
@@ -1348,6 +1337,7 @@ export default {
|
|
|
visible: "0",
|
|
|
tenantId: this.tenantId,
|
|
|
};
|
|
|
+ // 修改菜单
|
|
|
let result = await updateMenu(payLoad);
|
|
|
|
|
|
if(result.code == 200){
|
|
@@ -1483,18 +1473,17 @@ export default {
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
- console.log(selection);
|
|
|
+ // console.log(selection);
|
|
|
this.ids = selection.map((item) => item.id);
|
|
|
this.Keys = selection.map((item) => item.sqlKey);
|
|
|
selection.forEach(vals => {
|
|
|
this.menuIds = vals.groupTableInfo.map(item => item.menuId)
|
|
|
- console.log( this.menuIds);
|
|
|
+ // console.log( this.menuIds);
|
|
|
})
|
|
|
this.selection = selection;
|
|
|
this.single = selection.length !== 1;
|
|
|
this.multiple = !selection.length;
|
|
|
- },
|
|
|
-
|
|
|
+ },
|
|
|
/** 修改按钮操作 */
|
|
|
async handleUpdate(row) {
|
|
|
// 兼容勾选单个的修改
|
|
@@ -1528,7 +1517,7 @@ export default {
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
- console.log(row);
|
|
|
+ // console.log(row);
|
|
|
this.tableDataList.forEach((item, index) => {
|
|
|
if(row.tableKey == item.tableKey) {
|
|
|
this.tableDataList.splice(index, 1);
|
|
@@ -1541,7 +1530,7 @@ export default {
|
|
|
this.$router.addRoutes(accessRoutes); // 动态添加可访问路由表
|
|
|
});
|
|
|
},
|
|
|
- // 新增一个联动表格
|
|
|
+ // 新增一个表格
|
|
|
addOneTable() {
|
|
|
this.relateTitle = true
|
|
|
if(this.relateTitle){
|
|
@@ -1562,23 +1551,6 @@ export default {
|
|
|
// 注意校验最后一条数据是否合法
|
|
|
this.isShowForm = true;
|
|
|
},
|
|
|
-
|
|
|
- // 重置表单
|
|
|
- // tableItemFormReset() {
|
|
|
- // Object.assign(this.tableItemForm, {
|
|
|
- // title: "",
|
|
|
- // tableId: "",
|
|
|
- // tableName: "",
|
|
|
- // showFields: [],
|
|
|
- // theRelateField: "",
|
|
|
- // executeOptions: [],
|
|
|
- // });
|
|
|
- // },
|
|
|
- // handlePreview() {
|
|
|
- // this.$router.push({
|
|
|
- // path: "/system/fromModel/index/relateTableEdit",
|
|
|
- // });
|
|
|
- // },
|
|
|
},
|
|
|
};
|
|
|
</script>
|