forked from github/dataease
feat(数据更新): 同步
This commit is contained in:
parent
8c50976dcd
commit
b427e0b95f
@ -15,6 +15,8 @@ public class DatasetTable implements Serializable {
|
|||||||
|
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
private Integer mode;
|
||||||
|
|
||||||
private String createBy;
|
private String createBy;
|
||||||
|
|
||||||
private Long createTime;
|
private Long createTime;
|
||||||
|
@ -454,6 +454,66 @@ public class DatasetTableExample {
|
|||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Criteria andModeIsNull() {
|
||||||
|
addCriterion("`mode` is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andModeIsNotNull() {
|
||||||
|
addCriterion("`mode` is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andModeEqualTo(Integer value) {
|
||||||
|
addCriterion("`mode` =", value, "mode");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andModeNotEqualTo(Integer value) {
|
||||||
|
addCriterion("`mode` <>", value, "mode");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andModeGreaterThan(Integer value) {
|
||||||
|
addCriterion("`mode` >", value, "mode");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andModeGreaterThanOrEqualTo(Integer value) {
|
||||||
|
addCriterion("`mode` >=", value, "mode");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andModeLessThan(Integer value) {
|
||||||
|
addCriterion("`mode` <", value, "mode");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andModeLessThanOrEqualTo(Integer value) {
|
||||||
|
addCriterion("`mode` <=", value, "mode");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andModeIn(List<Integer> values) {
|
||||||
|
addCriterion("`mode` in", values, "mode");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andModeNotIn(List<Integer> values) {
|
||||||
|
addCriterion("`mode` not in", values, "mode");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andModeBetween(Integer value1, Integer value2) {
|
||||||
|
addCriterion("`mode` between", value1, value2, "mode");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andModeNotBetween(Integer value1, Integer value2) {
|
||||||
|
addCriterion("`mode` not between", value1, value2, "mode");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
public Criteria andCreateByIsNull() {
|
public Criteria andCreateByIsNull() {
|
||||||
addCriterion("create_by is null");
|
addCriterion("create_by is null");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
<result column="scene_id" jdbcType="VARCHAR" property="sceneId" />
|
<result column="scene_id" jdbcType="VARCHAR" property="sceneId" />
|
||||||
<result column="data_source_id" jdbcType="VARCHAR" property="dataSourceId" />
|
<result column="data_source_id" jdbcType="VARCHAR" property="dataSourceId" />
|
||||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||||
|
<result column="mode" jdbcType="INTEGER" property="mode" />
|
||||||
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
@ -72,7 +73,7 @@
|
|||||||
</where>
|
</where>
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, `name`, scene_id, data_source_id, `type`, create_by, create_time
|
id, `name`, scene_id, data_source_id, `type`, `mode`, create_by, create_time
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="Blob_Column_List">
|
<sql id="Blob_Column_List">
|
||||||
info
|
info
|
||||||
@ -127,11 +128,13 @@
|
|||||||
</delete>
|
</delete>
|
||||||
<insert id="insert" parameterType="io.dataease.base.domain.DatasetTable">
|
<insert id="insert" parameterType="io.dataease.base.domain.DatasetTable">
|
||||||
insert into dataset_table (id, `name`, scene_id,
|
insert into dataset_table (id, `name`, scene_id,
|
||||||
data_source_id, `type`, create_by,
|
data_source_id, `type`, `mode`,
|
||||||
create_time, info)
|
create_by, create_time, info
|
||||||
|
)
|
||||||
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{sceneId,jdbcType=VARCHAR},
|
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{sceneId,jdbcType=VARCHAR},
|
||||||
#{dataSourceId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
|
#{dataSourceId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{mode,jdbcType=INTEGER},
|
||||||
#{createTime,jdbcType=BIGINT}, #{info,jdbcType=LONGVARCHAR})
|
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{info,jdbcType=LONGVARCHAR}
|
||||||
|
)
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" parameterType="io.dataease.base.domain.DatasetTable">
|
<insert id="insertSelective" parameterType="io.dataease.base.domain.DatasetTable">
|
||||||
insert into dataset_table
|
insert into dataset_table
|
||||||
@ -151,6 +154,9 @@
|
|||||||
<if test="type != null">
|
<if test="type != null">
|
||||||
`type`,
|
`type`,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="mode != null">
|
||||||
|
`mode`,
|
||||||
|
</if>
|
||||||
<if test="createBy != null">
|
<if test="createBy != null">
|
||||||
create_by,
|
create_by,
|
||||||
</if>
|
</if>
|
||||||
@ -177,6 +183,9 @@
|
|||||||
<if test="type != null">
|
<if test="type != null">
|
||||||
#{type,jdbcType=VARCHAR},
|
#{type,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="mode != null">
|
||||||
|
#{mode,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
<if test="createBy != null">
|
<if test="createBy != null">
|
||||||
#{createBy,jdbcType=VARCHAR},
|
#{createBy,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
@ -212,6 +221,9 @@
|
|||||||
<if test="record.type != null">
|
<if test="record.type != null">
|
||||||
`type` = #{record.type,jdbcType=VARCHAR},
|
`type` = #{record.type,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="record.mode != null">
|
||||||
|
`mode` = #{record.mode,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
<if test="record.createBy != null">
|
<if test="record.createBy != null">
|
||||||
create_by = #{record.createBy,jdbcType=VARCHAR},
|
create_by = #{record.createBy,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
@ -233,6 +245,7 @@
|
|||||||
scene_id = #{record.sceneId,jdbcType=VARCHAR},
|
scene_id = #{record.sceneId,jdbcType=VARCHAR},
|
||||||
data_source_id = #{record.dataSourceId,jdbcType=VARCHAR},
|
data_source_id = #{record.dataSourceId,jdbcType=VARCHAR},
|
||||||
`type` = #{record.type,jdbcType=VARCHAR},
|
`type` = #{record.type,jdbcType=VARCHAR},
|
||||||
|
`mode` = #{record.mode,jdbcType=INTEGER},
|
||||||
create_by = #{record.createBy,jdbcType=VARCHAR},
|
create_by = #{record.createBy,jdbcType=VARCHAR},
|
||||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||||
info = #{record.info,jdbcType=LONGVARCHAR}
|
info = #{record.info,jdbcType=LONGVARCHAR}
|
||||||
@ -247,6 +260,7 @@
|
|||||||
scene_id = #{record.sceneId,jdbcType=VARCHAR},
|
scene_id = #{record.sceneId,jdbcType=VARCHAR},
|
||||||
data_source_id = #{record.dataSourceId,jdbcType=VARCHAR},
|
data_source_id = #{record.dataSourceId,jdbcType=VARCHAR},
|
||||||
`type` = #{record.type,jdbcType=VARCHAR},
|
`type` = #{record.type,jdbcType=VARCHAR},
|
||||||
|
`mode` = #{record.mode,jdbcType=INTEGER},
|
||||||
create_by = #{record.createBy,jdbcType=VARCHAR},
|
create_by = #{record.createBy,jdbcType=VARCHAR},
|
||||||
create_time = #{record.createTime,jdbcType=BIGINT}
|
create_time = #{record.createTime,jdbcType=BIGINT}
|
||||||
<if test="_parameter != null">
|
<if test="_parameter != null">
|
||||||
@ -268,6 +282,9 @@
|
|||||||
<if test="type != null">
|
<if test="type != null">
|
||||||
`type` = #{type,jdbcType=VARCHAR},
|
`type` = #{type,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="mode != null">
|
||||||
|
`mode` = #{mode,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
<if test="createBy != null">
|
<if test="createBy != null">
|
||||||
create_by = #{createBy,jdbcType=VARCHAR},
|
create_by = #{createBy,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
@ -286,6 +303,7 @@
|
|||||||
scene_id = #{sceneId,jdbcType=VARCHAR},
|
scene_id = #{sceneId,jdbcType=VARCHAR},
|
||||||
data_source_id = #{dataSourceId,jdbcType=VARCHAR},
|
data_source_id = #{dataSourceId,jdbcType=VARCHAR},
|
||||||
`type` = #{type,jdbcType=VARCHAR},
|
`type` = #{type,jdbcType=VARCHAR},
|
||||||
|
`mode` = #{mode,jdbcType=INTEGER},
|
||||||
create_by = #{createBy,jdbcType=VARCHAR},
|
create_by = #{createBy,jdbcType=VARCHAR},
|
||||||
create_time = #{createTime,jdbcType=BIGINT},
|
create_time = #{createTime,jdbcType=BIGINT},
|
||||||
info = #{info,jdbcType=LONGVARCHAR}
|
info = #{info,jdbcType=LONGVARCHAR}
|
||||||
@ -297,6 +315,7 @@
|
|||||||
scene_id = #{sceneId,jdbcType=VARCHAR},
|
scene_id = #{sceneId,jdbcType=VARCHAR},
|
||||||
data_source_id = #{dataSourceId,jdbcType=VARCHAR},
|
data_source_id = #{dataSourceId,jdbcType=VARCHAR},
|
||||||
`type` = #{type,jdbcType=VARCHAR},
|
`type` = #{type,jdbcType=VARCHAR},
|
||||||
|
`mode` = #{mode,jdbcType=INTEGER},
|
||||||
create_by = #{createBy,jdbcType=VARCHAR},
|
create_by = #{createBy,jdbcType=VARCHAR},
|
||||||
create_time = #{createTime,jdbcType=BIGINT}
|
create_time = #{createTime,jdbcType=BIGINT}
|
||||||
where id = #{id,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
|
@ -5,6 +5,7 @@ CREATE TABLE IF NOT EXISTS `dataset_table`
|
|||||||
`scene_id` varchar(50) NOT NULL COMMENT '场景ID',
|
`scene_id` varchar(50) NOT NULL COMMENT '场景ID',
|
||||||
`data_source_id` varchar(50) NOT NULL COMMENT '数据源ID',
|
`data_source_id` varchar(50) NOT NULL COMMENT '数据源ID',
|
||||||
`type` varchar(50) COMMENT 'db,sql,excel,custom',
|
`type` varchar(50) COMMENT 'db,sql,excel,custom',
|
||||||
|
`mode` int(10) DEFAULT 0 COMMENT '连接模式:0-直连,1-定时同步',
|
||||||
`info` longtext COMMENT '表原始信息',
|
`info` longtext COMMENT '表原始信息',
|
||||||
`create_by` varchar(50) COMMENT '创建人ID',
|
`create_by` varchar(50) COMMENT '创建人ID',
|
||||||
`create_time` bigint(13) COMMENT '创建时间',
|
`create_time` bigint(13) COMMENT '创建时间',
|
||||||
|
@ -512,6 +512,8 @@ export default {
|
|||||||
this.$post('/chart/group/getScene/' + sceneId, null, response => {
|
this.$post('/chart/group/getScene/' + sceneId, null, response => {
|
||||||
this.currGroup = response.data;
|
this.currGroup = response.data;
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
this.$router.push('/chart');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -27,6 +27,10 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item class="form-item">
|
||||||
|
<el-radio v-model="mode" label="0">{{$t('dataset.direct_connect')}}</el-radio>
|
||||||
|
<el-radio v-model="mode" label="1">{{$t('dataset.sync_data')}}</el-radio>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item class="form-item" style="float: right;">
|
<el-form-item class="form-item" style="float: right;">
|
||||||
<el-input
|
<el-input
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -62,7 +66,8 @@ export default {
|
|||||||
dataSource: '',
|
dataSource: '',
|
||||||
tables: [],
|
tables: [],
|
||||||
checkTableList: [],
|
checkTableList: [],
|
||||||
scene: null
|
scene: null,
|
||||||
|
mode: '0'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -86,12 +91,14 @@ export default {
|
|||||||
let sceneId = this.scene.id;
|
let sceneId = this.scene.id;
|
||||||
let dataSourceId = this.dataSource;
|
let dataSourceId = this.dataSource;
|
||||||
let tables = [];
|
let tables = [];
|
||||||
|
let mode = this.mode;
|
||||||
this.checkTableList.forEach(function (name) {
|
this.checkTableList.forEach(function (name) {
|
||||||
tables.push({
|
tables.push({
|
||||||
name: name,
|
name: name,
|
||||||
sceneId: sceneId,
|
sceneId: sceneId,
|
||||||
dataSourceId: dataSourceId,
|
dataSourceId: dataSourceId,
|
||||||
type: 'db'
|
type: 'db',
|
||||||
|
mode: parseInt(mode)
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
this.$post('/dataset/table/batchAdd', tables, response => {
|
this.$post('/dataset/table/batchAdd', tables, response => {
|
||||||
|
@ -82,6 +82,10 @@
|
|||||||
<span>
|
<span>
|
||||||
({{data.type}})
|
({{data.type}})
|
||||||
</span>
|
</span>
|
||||||
|
<span>
|
||||||
|
<span style="margin-left: 6px" v-if="data.mode === 0"><i class="el-icon-s-operation"></i></span>
|
||||||
|
<span style="margin-left: 6px" v-if="data.mode === 1"><i class="el-icon-time"></i></span>
|
||||||
|
</span>
|
||||||
<span style="margin-left: 6px">{{ data.name }}</span>
|
<span style="margin-left: 6px">{{ data.name }}</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
94
frontend/src/business/components/dataset/data/UpdateInfo.vue
Normal file
94
frontend/src/business/components/dataset/data/UpdateInfo.vue
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
<template>
|
||||||
|
<el-col>
|
||||||
|
<el-row>
|
||||||
|
<el-button icon="el-icon-setting" size="mini" @click="showConfig">
|
||||||
|
{{$t('dataset.update_setting')}}
|
||||||
|
</el-button>
|
||||||
|
</el-row>
|
||||||
|
<el-row style="margin-top: 10px;">
|
||||||
|
<!--TODO-->
|
||||||
|
<el-table
|
||||||
|
size="mini"
|
||||||
|
:data="tableData"
|
||||||
|
border
|
||||||
|
style="width: 100%">
|
||||||
|
<el-table-column
|
||||||
|
prop="date"
|
||||||
|
label="日期"
|
||||||
|
width="180">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="name"
|
||||||
|
label="姓名"
|
||||||
|
width="180">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="address"
|
||||||
|
label="地址">
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-dialog :title="table.name+' '+$t('dataset.update_setting')" :visible="update_setting" :show-close="false"
|
||||||
|
width="50%" class="dialog-css">
|
||||||
|
<el-row>
|
||||||
|
<el-button icon="el-icon-download" size="mini">
|
||||||
|
{{$t('dataset.sync_now')}}
|
||||||
|
</el-button>
|
||||||
|
<el-button icon="el-icon-plus" size="mini">
|
||||||
|
{{$t('dataset.add_task')}}
|
||||||
|
</el-button>
|
||||||
|
</el-row>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button size="mini" @click="update_setting = false">{{$t('dataset.cancel')}}</el-button>
|
||||||
|
<el-button type="primary" size="mini" @click="update_setting = false">{{$t('dataset.confirm')}}</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
table: Object,
|
||||||
|
},
|
||||||
|
name: "UpdateInfo",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
update_setting: false,
|
||||||
|
tableData: [{
|
||||||
|
date: '2016-05-02',
|
||||||
|
name: '王小虎',
|
||||||
|
address: '上海市普陀区金沙江路 1518 弄'
|
||||||
|
}, {
|
||||||
|
date: '2016-05-04',
|
||||||
|
name: '王小虎',
|
||||||
|
address: '上海市普陀区金沙江路 1517 弄'
|
||||||
|
}, {
|
||||||
|
date: '2016-05-01',
|
||||||
|
name: '王小虎',
|
||||||
|
address: '上海市普陀区金沙江路 1519 弄'
|
||||||
|
}, {
|
||||||
|
date: '2016-05-03',
|
||||||
|
name: '王小虎',
|
||||||
|
address: '上海市普陀区金沙江路 1516 弄'
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showConfig() {
|
||||||
|
this.update_setting = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.dialog-css >>> .el-dialog__header {
|
||||||
|
padding: 20px 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dialog-css >>> .el-dialog__body {
|
||||||
|
padding: 10px 20px 20px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -10,9 +10,9 @@
|
|||||||
<el-button size="mini" @click="edit">
|
<el-button size="mini" @click="edit">
|
||||||
{{$t('dataset.edit')}}
|
{{$t('dataset.edit')}}
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- <el-button size="mini" type="primary" @click="createChart">-->
|
<!-- <el-button size="mini" type="primary" @click="createChart">-->
|
||||||
<!-- {{$t('dataset.create_view')}}-->
|
<!-- {{$t('dataset.create_view')}}-->
|
||||||
<!-- </el-button>-->
|
<!-- </el-button>-->
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-divider/>
|
<el-divider/>
|
||||||
@ -25,14 +25,8 @@
|
|||||||
关联视图 TODO
|
关联视图 TODO
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane :label="$t('dataset.update_info')" name="updateInfo">
|
<el-tab-pane :label="$t('dataset.update_info')" name="updateInfo">
|
||||||
更新信息 TODO
|
<update-info :table="table"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<!-- <el-tab-pane label="tab3" name="tab3">-->
|
|
||||||
<!-- tab3-->
|
|
||||||
<!-- </el-tab-pane>-->
|
|
||||||
<!-- <el-tab-pane label="tab4" name="tab4">-->
|
|
||||||
<!-- tab4-->
|
|
||||||
<!-- </el-tab-pane>-->
|
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
|
||||||
<el-dialog :title="table.name" :visible.sync="editField" :fullscreen="true" :show-close="false">
|
<el-dialog :title="table.name" :visible.sync="editField" :fullscreen="true" :show-close="false">
|
||||||
@ -66,20 +60,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog title="view" :visible.sync="createViewDialog" :fullscreen="true">
|
<!-- <el-dialog title="view" :visible.sync="createViewDialog" :fullscreen="true">-->
|
||||||
<chart-edit/>
|
<!-- <chart-edit/>-->
|
||||||
</el-dialog>
|
<!-- </el-dialog>-->
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-col>
|
</el-col>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import TabDataPreview from "./TabDataPreview";
|
import TabDataPreview from "./TabDataPreview";
|
||||||
import ChartEdit from "../../chart/view/ChartEdit";
|
import UpdateInfo from "./UpdateInfo";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ViewTable",
|
name: "ViewTable",
|
||||||
components: {ChartEdit, TabDataPreview},
|
components: {UpdateInfo, TabDataPreview},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
createViewDialog: false,
|
createViewDialog: false,
|
||||||
|
@ -143,12 +143,12 @@
|
|||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
<el-button type="primary" size="mini" plain>
|
<!-- <el-button type="primary" size="mini" plain>-->
|
||||||
{{$t('dataset.update')}}
|
<!-- {{$t('dataset.update')}}-->
|
||||||
</el-button>
|
<!-- </el-button>-->
|
||||||
<el-button type="primary" size="mini" plain>
|
<!-- <el-button type="primary" size="mini" plain>-->
|
||||||
{{$t('dataset.process')}}
|
<!-- {{$t('dataset.process')}}-->
|
||||||
</el-button>
|
<!-- </el-button>-->
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-form>
|
<el-form>
|
||||||
@ -174,6 +174,10 @@
|
|||||||
<span>
|
<span>
|
||||||
({{data.type}})
|
({{data.type}})
|
||||||
</span>
|
</span>
|
||||||
|
<span>
|
||||||
|
<span style="margin-left: 6px" v-if="data.mode === 0"><i class="el-icon-s-operation"></i></span>
|
||||||
|
<span style="margin-left: 6px" v-if="data.mode === 1"><i class="el-icon-time"></i></span>
|
||||||
|
</span>
|
||||||
<span style="margin-left: 6px">{{ data.name }}</span>
|
<span style="margin-left: 6px">{{ data.name }}</span>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
@ -187,8 +191,8 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item icon="el-icon-edit-outline" :command="beforeClickMore('renameTable',data,node)">
|
<el-dropdown-item icon="el-icon-edit-outline" :command="beforeClickMore('editTable',data,node)">
|
||||||
{{$t('dataset.rename')}}
|
{{$t('dataset.edit')}}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<!-- <el-dropdown-item icon="el-icon-right" :command="beforeClickMore('move',data,node)">-->
|
<!-- <el-dropdown-item icon="el-icon-right" :command="beforeClickMore('move',data,node)">-->
|
||||||
<!-- {{$t('dataset.move_to')}}-->
|
<!-- {{$t('dataset.move_to')}}-->
|
||||||
@ -208,6 +212,10 @@
|
|||||||
<el-form-item :label="$t('commons.name')" prop="name">
|
<el-form-item :label="$t('commons.name')" prop="name">
|
||||||
<el-input v-model="tableForm.name"></el-input>
|
<el-input v-model="tableForm.name"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('dataset.mode')" prop="mode">
|
||||||
|
<el-radio v-model="tableForm.mode" label="0">{{$t('dataset.direct_connect')}}</el-radio>
|
||||||
|
<el-radio v-model="tableForm.mode" label="1">{{$t('dataset.sync_data')}}</el-radio>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="closeTable()" size="mini">{{$t('dataset.cancel')}}</el-button>
|
<el-button @click="closeTable()" size="mini">{{$t('dataset.cancel')}}</el-button>
|
||||||
@ -243,6 +251,7 @@ export default {
|
|||||||
},
|
},
|
||||||
tableForm: {
|
tableForm: {
|
||||||
name: '',
|
name: '',
|
||||||
|
mode: '',
|
||||||
sort: 'type asc,create_time desc,name asc'
|
sort: 'type asc,create_time desc,name asc'
|
||||||
},
|
},
|
||||||
groupFormRules: {
|
groupFormRules: {
|
||||||
@ -254,6 +263,9 @@ export default {
|
|||||||
name: [
|
name: [
|
||||||
{required: true, message: this.$t('commons.input_content'), trigger: 'blur'},
|
{required: true, message: this.$t('commons.input_content'), trigger: 'blur'},
|
||||||
],
|
],
|
||||||
|
mode: [
|
||||||
|
{required: true, message: this.$t('commons.input_content'), trigger: 'blur'},
|
||||||
|
],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -305,9 +317,10 @@ export default {
|
|||||||
case 'delete':
|
case 'delete':
|
||||||
this.delete(param.data);
|
this.delete(param.data);
|
||||||
break;
|
break;
|
||||||
case 'renameTable':
|
case 'editTable':
|
||||||
this.editTable = true;
|
this.editTable = true;
|
||||||
this.tableForm = JSON.parse(JSON.stringify(param.data));
|
this.tableForm = JSON.parse(JSON.stringify(param.data));
|
||||||
|
this.tableForm.mode = this.tableForm.mode + '';
|
||||||
break;
|
break;
|
||||||
case 'deleteTable':
|
case 'deleteTable':
|
||||||
this.deleteTable(param.data);
|
this.deleteTable(param.data);
|
||||||
@ -362,6 +375,7 @@ export default {
|
|||||||
|
|
||||||
saveTable(table) {
|
saveTable(table) {
|
||||||
console.log(table);
|
console.log(table);
|
||||||
|
table.mode = parseInt(table.mode);
|
||||||
this.$refs['tableForm'].validate((valid) => {
|
this.$refs['tableForm'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$post("/dataset/table/update", table, response => {
|
this.$post("/dataset/table/update", table, response => {
|
||||||
@ -538,6 +552,8 @@ export default {
|
|||||||
this.$post('/dataset/group/getScene/' + sceneId, null, response => {
|
this.$post('/dataset/group/getScene/' + sceneId, null, response => {
|
||||||
this.currGroup = response.data;
|
this.currGroup = response.data;
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
this.$router.push('/dataset');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1600,6 +1600,12 @@ export default {
|
|||||||
join_view: 'Relation View',
|
join_view: 'Relation View',
|
||||||
text: 'Text',
|
text: 'Text',
|
||||||
time: 'Time',
|
time: 'Time',
|
||||||
value: 'Value'
|
value: 'Value',
|
||||||
|
mode:'Mode',
|
||||||
|
direct_connect:'Direct',
|
||||||
|
sync_data:'Sync',
|
||||||
|
update_setting:'Config',
|
||||||
|
sync_now:'Sync Now',
|
||||||
|
add_task:'Add Task'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1621,7 +1621,13 @@ export default {
|
|||||||
join_view: '关联视图',
|
join_view: '关联视图',
|
||||||
text: '文本',
|
text: '文本',
|
||||||
time: '时间',
|
time: '时间',
|
||||||
value: '数值'
|
value: '数值',
|
||||||
|
mode:'模式',
|
||||||
|
direct_connect:'直连',
|
||||||
|
sync_data:'定时同步',
|
||||||
|
update_setting:'更新设置',
|
||||||
|
sync_now:'立即更新',
|
||||||
|
add_task:'添加任务'
|
||||||
},
|
},
|
||||||
datasource: {
|
datasource: {
|
||||||
create: '新建数据连接',
|
create: '新建数据连接',
|
||||||
|
@ -1601,6 +1601,12 @@ export default {
|
|||||||
join_view: '關聯視圖',
|
join_view: '關聯視圖',
|
||||||
text: '文本',
|
text: '文本',
|
||||||
time: '時間',
|
time: '時間',
|
||||||
value: '數值'
|
value: '數值',
|
||||||
|
mode:'模式',
|
||||||
|
direct_connect:'直連',
|
||||||
|
sync_data:'定時同步',
|
||||||
|
update_setting:'更新設置',
|
||||||
|
sync_now:'立即更新',
|
||||||
|
add_task:'添加任務'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user