master
lion 1 year ago
parent 45eec7a224
commit 94723f0008

@ -24,6 +24,7 @@
"element-ui": "2.15.13",
"file-saver": "^2.0.5",
"js-cookie": "2.2.0",
"less": "^3.13.1",
"less-loader": "^5.0.0",
"moment": "^2.29.2",
"normalize.css": "7.0.0",

@ -22,3 +22,20 @@ export function del(data) {
data
})
}
export function lastSyncAt() {
return request({
url: '/api/admin/department/last-sync-at',
method: 'get'
})
}
export function syncDepartment(data) {
return request({
url: '/api/admin/department/sync-department',
method: 'post',
data
})
}

@ -8,8 +8,8 @@
<slot>
<div>
<!-- <Button type="primary" @click="load" style="margin-left: 10px">查询</Button> -->
<Button type="primary" @click="edit()" style="margin:0 10px">立即同步</Button>
<span>最后同步时间</span>
<Button type="primary" @click="departmentShow = true" style="margin:0 10px">立即同步</Button>
<span>最后同步时间{{syncAt}}</span>
</div>
</slot>
</LxHeader>
@ -76,6 +76,14 @@
</div>
</el-dialog>
<el-dialog title="同步部门信息" :visible.sync="departmentShow" width="30%">
<div style="font-size: 20px;">是否确认同步管党治党平台的部门信息?</div>
<div slot="footer" class="dialog-footer">
<el-button @click="departmentShow = false"> </el-button>
<el-button type="primary" @click="getSyncDepartment"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
@ -83,7 +91,9 @@
import {
listdept,
save,
del
del,
lastSyncAt,
syncDepartment
} from "../../api/system/department.js";
import {
listuser
@ -96,11 +106,14 @@
created() {
this.initLoad();
this.load();
this.getLastAt()
},
mounted() {},
data() {
return {
dialogFormVisible: false,
departmentShow:false,
syncAt:'',
formLabelWidth: "120px",
form: {
name: "",
@ -171,6 +184,18 @@
})
},
getLastAt(){
lastSyncAt().then(res=>{
this.syncAt = res.msg?res.msg:''
})
},
getSyncDepartment(){
syncDepartment().then(res=>{
this.load()
this.getLastAt()
this.departmentShow = false
})
},
edit(obj) {
this.form = this.$options.data().form
if (obj) {

Loading…
Cancel
Save