|
@@ -63,7 +63,20 @@
|
|
|
<el-table-column prop="fieldDescription" label="字段描述">
|
|
|
<template slot-scope="scope">
|
|
|
<!-- <el-form-item size="normal" prop="fieldDescription"> -->
|
|
|
- <el-input v-model="scope.row.fieldDescription"></el-input>
|
|
|
+ <input
|
|
|
+ :class="{
|
|
|
+ isNullDesc:
|
|
|
+ scope.row.fieldDescription == '' &&
|
|
|
+ scope.row.isShow &&
|
|
|
+ isInputInvalid
|
|
|
+ ? true
|
|
|
+ : false,
|
|
|
+ ipt: true,
|
|
|
+ }"
|
|
|
+ v-model="scope.row.fieldDescription"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- <el-input v-model="scope.row.fieldDescription" /> -->
|
|
|
<!-- </el-form-item> -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -168,6 +181,11 @@
|
|
|
<el-switch v-model="scope.row.isExport"> </el-switch>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <!-- <el-table-column prop="isCount" label="是否统计">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-switch v-model="scope.row.isCount"> </el-switch>
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
<!-- <el-table-column
|
|
|
label="操作"
|
|
|
align="center"
|
|
@@ -292,7 +310,7 @@
|
|
|
class="inline-large-button"
|
|
|
icon="el-icon-plus"
|
|
|
size="mini"
|
|
|
- @click="isShowAddData = true"
|
|
|
+ @click="addDataDialog"
|
|
|
>
|
|
|
添加数据字段
|
|
|
</el-button>
|
|
@@ -302,22 +320,55 @@
|
|
|
>
|
|
|
|
|
|
<el-table
|
|
|
- :data="datacountTable"
|
|
|
+ :data="dragTableStatisticList"
|
|
|
border
|
|
|
class="mb10"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
<el-table-column prop="number" label="序号" width="50">
|
|
|
+ style="width: 100%">
|
|
|
+ <el-table-column
|
|
|
+ type="index"
|
|
|
+ label="序号"
|
|
|
+ width="50"
|
|
|
+ class-name="allowDrag"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="datafield" label="数据字段" width="80">
|
|
|
+ <el-table-column
|
|
|
+ prop="statisticTitle"
|
|
|
+ label="统计标题"
|
|
|
+ width="83">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="statisticField"
|
|
|
+ label="统计数据"
|
|
|
+ width="80">
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="type" label="类型" width="50">
|
|
|
+ <el-table-column
|
|
|
+ prop="statisticType"
|
|
|
+ label="统计类型"
|
|
|
+ width="50">
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="statuscode" label="状态码" width="70">
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="title" label="标题" width="83">
|
|
|
+ <!-- <el-table-column
|
|
|
+ prop="statuscode"
|
|
|
+ label="状态码"
|
|
|
+ width="70">
|
|
|
+ </el-table-column> -->
|
|
|
+ <el-table-column
|
|
|
+ prop="statisticDescription"
|
|
|
+ label="统计描述"
|
|
|
+ width="150">
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="description" label="描述" width="150">
|
|
|
+ <el-table-column
|
|
|
+ prop="statisticObject"
|
|
|
+ label="统计对象"
|
|
|
+ width="150">
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</el-tab-pane>
|
|
@@ -499,12 +550,37 @@
|
|
|
:value="item.fieldName"
|
|
|
>
|
|
|
</el-option>
|
|
|
+ width="30%">
|
|
|
+
|
|
|
+ <el-form
|
|
|
+ label-width="100px"
|
|
|
+ :model="dataCountFormData">
|
|
|
+ <el-form-item label="统计标题" prop="statisticTitle">
|
|
|
+ <el-input v-model="dataCountFormData.statisticTitle"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="统计数据">
|
|
|
+ <el-select
|
|
|
+ v-model="dataCountFormData.statisticField"
|
|
|
+ placeholder="请选择统计字段">
|
|
|
+ <el-option
|
|
|
+ v-for="item in dataArr"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.fieldName"
|
|
|
+ :value="item.fieldName">
|
|
|
+ </el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="类型">
|
|
|
<el-select v-model="dataCountFormData.type" placeholder="请选择类型">
|
|
|
<el-option label="数量" value="num"></el-option>
|
|
|
<el-option label="状态" value="status"></el-option>
|
|
|
+ <el-form-item label="统计类型">
|
|
|
+ <el-select
|
|
|
+ v-model="dataCountFormData.statisticType"
|
|
|
+ placeholder="请选择统计类型">
|
|
|
+ <el-option v-for="item in dataType" :key="item.dictCode" :label="item.dictLabel" :value="item.dictLabel"></el-option>
|
|
|
+ <!-- <el-option label="状态" value="status"></el-option> -->
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
@@ -516,17 +592,22 @@
|
|
|
v-model="dataCountFormData.statuscode"
|
|
|
placeholder="请选择状态码"
|
|
|
>
|
|
|
+<!--
|
|
|
+ <el-form-item label="状态码" v-show="dataCountFormData.statisticType === 'status' ">
|
|
|
+ <el-select
|
|
|
+ v-model="dataCountFormData.statuscode"
|
|
|
+ placeholder="请选择状态码">
|
|
|
<el-option label="已完成" value="1"></el-option>
|
|
|
<el-option label="未完成" value="0"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ -->
|
|
|
|
|
|
- <el-form-item label="标题" prop="title">
|
|
|
- <el-input v-model="dataCountFormData.title"></el-input>
|
|
|
+ <el-form-item label="统计描述" prop="statisticDescription">
|
|
|
+ <el-input v-model="dataCountFormData.statisticDescription"></el-input>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="描述" prop="description">
|
|
|
- <el-input v-model="dataCountFormData.description"></el-input>
|
|
|
+ <el-form-item label="统计对象" prop="statisticObject">
|
|
|
+ <el-input v-model="dataCountFormData.statisticObject"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
@@ -564,11 +645,12 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
import { v4 as uuidv4 } from "uuid";
|
|
|
export default {
|
|
|
name: "tableMange",
|
|
|
- dicts: ["sys_time_format"],
|
|
|
+ dicts: ["sys_time_format", "table_statistic_type"],
|
|
|
props: [],
|
|
|
components: { Queryfrom, Treeselect },
|
|
|
data() {
|
|
|
return {
|
|
|
+ isInputInvalid: false,
|
|
|
// 修改表格时的menuId
|
|
|
menuId: "",
|
|
|
// 修改表格的id
|
|
@@ -584,6 +666,7 @@ export default {
|
|
|
// 当前table唯一标识
|
|
|
sqlkey: "",
|
|
|
// 表格的高度
|
|
|
+ tableKey: "",
|
|
|
// tableHeight: document.documentElement.scrollHeight - 245 + "px",
|
|
|
tableList: [], //所有表格列表
|
|
|
tableFieldList: [], // 当前表格字段数据
|
|
@@ -640,6 +723,10 @@ export default {
|
|
|
prop: "isExport",
|
|
|
label: "是否导出",
|
|
|
},
|
|
|
+ {
|
|
|
+ prop: "isCount",
|
|
|
+ label: "是否统计",
|
|
|
+ },
|
|
|
], //表头列表
|
|
|
|
|
|
// 右侧筛选条件勾选数据
|
|
@@ -695,11 +782,12 @@ export default {
|
|
|
// 数据统计对象
|
|
|
dataCountFormData: {},
|
|
|
// 数据统计表格
|
|
|
- datacountTable: [],
|
|
|
+ dragTableStatisticList: [],
|
|
|
// 是否切换到数据统计
|
|
|
menudata: false,
|
|
|
// 显示添加字段对话框
|
|
|
isShowAddData: false,
|
|
|
+ dataType : [],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -761,6 +849,10 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 字段描述验证规则
|
|
|
+ // blurval(value){
|
|
|
+ // this.isInputInvalid = value == '' ? true : false;
|
|
|
+ // },
|
|
|
// 树形控件change回调
|
|
|
treeSelectChange(val) {
|
|
|
//没有change事件
|
|
@@ -786,9 +878,10 @@ export default {
|
|
|
databaseType: this.databaseType,
|
|
|
tableName: this.tableName,
|
|
|
};
|
|
|
-
|
|
|
+ console.log(data);
|
|
|
// 获取当前表单结构信息
|
|
|
getListName(data).then((res) => {
|
|
|
+ console.log(res);
|
|
|
this.tableFieldList = res.map((item, index) => {
|
|
|
return {
|
|
|
id: this.tableName + "_" + item.fieldName,
|
|
@@ -1269,6 +1362,9 @@ export default {
|
|
|
},
|
|
|
// 创建回调
|
|
|
async createHandle() {
|
|
|
+ console.log(123);
|
|
|
+ this.tableKey = uuidv4();
|
|
|
+ this.isInputInvalid = true;
|
|
|
this.$refs.formData.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
// 检验表单合法性
|
|
@@ -1359,7 +1455,7 @@ export default {
|
|
|
tId: this.tId,
|
|
|
dtName: this.formData.menuName,
|
|
|
// menuId: this.formData.routePath,
|
|
|
- // tableKey: this.formData.routePath, // 暂定
|
|
|
+ tableKey: this.tableKey, // 暂定
|
|
|
dtTableName: this.tableName,
|
|
|
primaryKey: this.formData.primaryKey,
|
|
|
orderByColumn: this.formData.orderByColumn,
|
|
@@ -1404,6 +1500,10 @@ export default {
|
|
|
res = await addDragTable(data);
|
|
|
}
|
|
|
|
|
|
+ console.log("res", res);
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.countHandle();
|
|
|
+ }
|
|
|
// 关闭当前页面
|
|
|
if (this.tId) {
|
|
|
if (res.code == 200) {
|
|
@@ -1500,6 +1600,20 @@ export default {
|
|
|
tabhandleClick() {
|
|
|
this.menudata = this.activeName === "datacount" ? true : false;
|
|
|
},
|
|
|
+ // 添加数据字段对话框
|
|
|
+ async addDataDialog() {
|
|
|
+ this.isShowAddData = true;
|
|
|
+ this.dataType = await this.getDicts("table_statistic_type");
|
|
|
+ this.dataType = this.dataType.data;
|
|
|
+ // console.log(this.dataType)
|
|
|
+ },
|
|
|
+ // 添加数据字段对话框
|
|
|
+ async addDataDialog() {
|
|
|
+ this.isShowAddData = true
|
|
|
+ this.dataType = await this.getDicts("table_statistic_type")
|
|
|
+ this.dataType = this.dataType.data
|
|
|
+ // console.log(this.dataType)
|
|
|
+ },
|
|
|
// 添加数据字段
|
|
|
addData() {
|
|
|
this.dataCountFormData.number = this.datacountTable.length + 1;
|
|
@@ -1523,6 +1637,8 @@ export default {
|
|
|
// 确定统计
|
|
|
countHandle() {
|
|
|
if (this.datacountTable.length == 0) {
|
|
|
+ countHandle(){
|
|
|
+ if(this.dragTableStatisticList.length == 0){
|
|
|
this.$message.warning("请确定统计数据字段");
|
|
|
return;
|
|
|
}
|
|
@@ -1543,6 +1659,26 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
+.ipt {
|
|
|
+ height: 36px;
|
|
|
+ line-height: 36px;
|
|
|
+ font-size: 14px;
|
|
|
+ width: 100%;
|
|
|
+ outline: none;
|
|
|
+ text-align: center;
|
|
|
+ background-color: #fff;
|
|
|
+ border: 1px solid #dcdfe6;
|
|
|
+ color: #606266;
|
|
|
+ display: inline-block;
|
|
|
+ border-radius: 4px;
|
|
|
+}
|
|
|
+.isNullDesc {
|
|
|
+ border-color: #ff4949 !important;
|
|
|
+}
|
|
|
+
|
|
|
+.ipt:focus {
|
|
|
+ border-color: #1890ff;
|
|
|
+}
|
|
|
::v-deep .right_card {
|
|
|
min-height: 500px !important;
|
|
|
}
|