同步模型及导入模型、日志列表等联调

dev_2022-03-03
yujialong 3 years ago
parent 06fbe7d4c7
commit 2c6fe60b1d
  1. 15
      src/setting.js
  2. 23
      src/utils/api.js
  3. 26
      src/views/serve/addModel.vue
  4. 172
      src/views/serve/backstage/model.vue
  5. 89
      src/views/serve/backstage/modelType.vue
  6. 5
      src/views/serve/backstage/sourceType.vue
  7. 44
      src/views/system/addLog.vue
  8. 11
      src/views/system/index.vue
  9. 34
      src/views/system/log.vue
  10. 39
      src/views/system/manageLog.vue

@ -36,6 +36,21 @@ const Setting = {
platformId: 3, // 平台标识,1职站,2数据平台,3中台
jumpPath, // 判分点系统跳转路径前缀
host, // 请求路径前缀
// 平台列表
platformList: [
{
id: 1,
name: '职站'
},
{
id: 2,
name: '数据平台'
},
{
id: 3,
name: '中台'
}
]
};
export default Setting;

@ -1,9 +1,8 @@
import Setting from "@/setting";
let host = Setting.host;
// let uploadURL = "http://www.huorantech.cn:9000";
// let uploadURL = "http://124.71.12.62:9000";
let uploadURL = "http://39.108.250.202:9000";
const host = Setting.host;
const host1 = 'http://192.168.31.137:9000'
const uploadURL = "http://39.108.250.202:9000";
export default {
@ -104,6 +103,12 @@ export default {
saveReferenceCategory: `${host}/nakadai/model/reference/saveReferenceCategory`,
updateModelClass: `${host}/nakadai/model/reference/updateModelClass`,
delModelInfoBySystemId: `${host}/nakadai/model/reference/demo/delModelInfoBySystemId`,
deleteReferenceDemo: `${host}/nakadai/model/reference/demo/deleteReferenceDemo`,
referenceFindById: `${host}/nakadai/model/reference/demo/findById`,
saveReferenceDemo: `${host}/nakadai/model/reference/demo/saveReferenceDemo`,
referenceDemoList: `${host}/nakadai/model/reference/demo/referenceDemoList`,
deleteSourceModelCategory: `${host}/nakadai/model/category/deleteSourceModelCategory`,
categorySave: `${host}/nakadai/model/category/save`,
sourceModelClassification: `${host}/nakadai/model/category/sourceModelClassification`,
@ -200,5 +205,13 @@ export default {
// 关键词
addKeyword: `${host}/data/keyword/addKeyword`,
deleteKeyword: `${host}/data/keyword/deleteKeyword`,
getKeywordByCategoryId: `${host}/data/keyword/getKeywordByCategoryId`
getKeywordByCategoryId: `${host}/data/keyword/getKeywordByCategoryId`,
// 日志管理
logAdd: `${host1}/nakadai/log/add`,
logDel: `${host1}/nakadai/log/delete`,
logGet: `${host1}/nakadai/log/get`,
logManagementList: `${host1}/nakadai/log/logManagementList`,
platformLogList: `${host1}/nakadai/log/platformLogList`,
listUpdate: `${host1}/nakadai/log/update`,
};

@ -40,7 +40,8 @@ export default {
categoryId : Number(this.$route.query.categoryId),
id : Number(this.$route.query.id),
postStatus : Number(this.$route.query.postStatus),
isDetail : Boolean(this.$route.query.show),
isDetail : Boolean(this.$route.query.show), //
isModel : Boolean(this.$route.query.model), //
form: {
modelName: '',
modelDemo: ''
@ -54,12 +55,23 @@ export default {
methods: {
//
getData() {
this.$post(`${this.api.modelFindById}?id=${this.id}`).then(res => {
const { data } = res
this.form.modelName = data.modelName
this.form.modelDemo = data.modelDemo
this.codeKey++
}).catch(res => {})
//
if (this.isModel) {
this.$post(`${this.api.referenceFindById}?id=${this.id}`).then(res => {
const { data } = res
this.form.modelName = data.modelName
this.form.modelDemo = data.modelDemo
this.codeKey++
}).catch(res => {})
} else {
//
this.$post(`${this.api.modelFindById}?id=${this.id}`).then(res => {
const { data } = res
this.form.modelName = data.modelName
this.form.modelDemo = data.modelDemo
this.codeKey++
}).catch(res => {})
}
},
//
submit(postStatus){

@ -1,7 +1,7 @@
<template>
<div class="wrap">
<div class="side">
<org ref="org"></org>
<org ref="tree" @initData="initData"></org>
</div>
<div class="right">
@ -21,12 +21,16 @@
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" label="序号" width="55" align="center"></el-table-column>
<el-table-column prop="userName" label="模型名称" align="center"></el-table-column>
<el-table-column prop="account" label="导入时间" align="center"></el-table-column>
<el-table-column prop="workNumber" label="状态" align="center"></el-table-column>
<el-table-column prop="modelName" label="模型名称" align="center"></el-table-column>
<el-table-column prop="createTime" label="导入时间" align="center"></el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
{{ scope.row.isOpen ? '禁用' : '启用' }}
</template>
</el-table-column>
<el-table-column label="操作" width="200" align="center">
<template slot-scope="scope">
<el-button type="text" @click="showTeacher(scope.row)">查看</el-button>
<el-button type="text" @click="show(scope.row)">查看</el-button>
<el-button type="text" @click="del(scope.row)">移除</el-button>
</template>
</el-table-column>
@ -39,13 +43,14 @@
<el-dialog title="请选择需要导入的模型" :visible.sync="modelVisible" width="500px" class="dialog" :close-on-click-modal="false">
<el-tree
:data="modelData"
ref="tree"
ref="model"
default-expand-all
show-checkbox
:check-strictly="true"
node-key="id">
node-key="id"
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}">
</el-tree>
<span slot="footer" class="dialog-footer" v-if="!isDetail">
<span slot="footer" class="dialog-footer">
<el-button @click="modelVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
@ -57,6 +62,7 @@ import org from "./modelType"
export default {
data() {
return {
systemId: this.$route.query.systemId,
listData: [],
keyword: '',
page: 1,
@ -64,56 +70,7 @@ export default {
total: 0,
multipleSelection: [],
modelVisible: false,
modelData: [
{
id: 1,
label: '品牌一',
children: [
{
id: 4,
label: '华东区域',
children: [
{
id: 9,
label: '上海'
},
{
id: 10,
label: '昆山'
}
]
}
]
},
{
id: 2,
label: '品牌二',
children: [
{
id: 5,
label: '华东区域'
},
{
id: 6,
label: '华南区域'
}
]
},
{
id: 3,
label: '品牌三',
children: [
{
id: 7,
label: '华北区域'
},
{
id: 8,
label: '华南区域'
}
]
}
]
modelData: []
};
},
components: {
@ -130,17 +87,15 @@ export default {
mounted() {},
methods: {
getData() {
let data = {
keyWord: this.keyword,
this.$post(this.api.referenceDemoList, {
modelName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
staffArchitectureId: this.staffArchitectureId,
gradeId: this.gradeId
};
this.$post(this.api.staffList, data).then(res => {
this.listData = res.page.records;
this.total = res.page.total;
}).catch(res => {});
categoryId: this.$refs.tree.$refs.tree.getCurrentKey()
}).then(res => {
this.listData = res.data.records
this.total = res.data.total
}).catch(res => {})
},
initData() {
this.$refs.table.clearSelection()
@ -150,21 +105,55 @@ export default {
//
add() {
this.modelVisible = true
//
this.$post(this.api.sourceModelClassification).then(res => {
const { data } = res
const promises = []
const addType = list => {
list.map(e => {
// promise
promises.push(new Promise((resolve,reject) => {
this.$post(this.api.sysModelDemoList, {
pageNum: 1,
pageSize: 10000,
categoryId: e.id
}).then(res => {
const { records } = res.data
records.map(n => {
n.categoryName = n.modelName
})
e.children = [...e.children, ...records]
// console.log(11, e)
resolve()
}).catch(res => {
reject()
})
}))
e.children && e.children.length && addType(e.children)
})
}
addType(data)
// debugger
console.log(data, promises)
Promise.all(promises).then(_ => {
this.modelData = data
}).catch(res => {})
}).catch(res => {})
},
//
show(row) {
this.modelVisible = true
this.$router.push(`/addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${row.id}&show=1&model=1`)
},
//
del(row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.delStaff}?accountIds=${row.accountId}`).then(res => {
this.$message.success("删除成功");
this.getData();
}).catch(res => {});
}).catch(() => {});
this.$post(this.api.deleteReferenceDemo, [row.id]).then(res => {
this.$message.success("删除成功")
this.getData()
}).catch(res => {})
}).catch(() => {})
},
handleSelectionChange(val) {
this.multipleSelection = val
@ -175,20 +164,15 @@ export default {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(item => {
return item.accountId;
});
this.$post(`${this.api.delStaff}?accountIds=${ids.toString()}`).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection();
this.$message.success("删除成功");
this.getData();
}).catch(res => {
});
}).catch(() => {
});
let ids = this.multipleSelection.map(e => e.id)
this.$post(this.api.deleteReferenceDemo, ids).then(res => {
this.$refs.table.clearSelection()
this.$message.success("删除成功")
this.getData()
}).catch(res => {})
}).catch(() => {})
} else {
this.$message.error("请先选择模型 !");
this.$message.error("请先选择模型 !")
}
},
handleCurrentChange(val) {
@ -197,7 +181,21 @@ export default {
},
//
submit() {
const data = []
const systemId = this.systemId
const list = this.$refs.model.getCheckedNodes()
const categoryId = this.$refs.tree.$refs.tree.getCurrentKey() //
list.map(e => {
data.push({
systemId,
categoryId,
copyId: e.id
})
})
this.$post(this.api.saveReferenceDemo, data).then(res => {
this.modelVisible = false
this.initData()
}).catch(res => {})
}
}
};

@ -99,7 +99,96 @@ export default {
},
//
syncModel() {
this.$confirm('同步后当前的组织架构将会被删除,是否继续?', '提示', {
type: 'warning'
}).then(() => {
//
this.$post(`${this.api.delModelInfoBySystemId}?systemId=${this.systemId}`).then(res => {
//
this.$post(this.api.saveReferenceCategory, {
categoryName: '全部',
systemId: this.systemId,
level: 0,
parentId: 0
}).then(res => {
this.addData(res.referenceCategoryId)
}).catch(res => {})
})
}).catch(() => {})
},
//
async addData(id) {
//
this.$post(this.api.sourceModelClassification).then((res) => {
const { data } = res
const systemId = this.systemId
const promises = []
//
const addType = (list, refId) => {
list.map(e => {
// promise
promises.push(new Promise(async (resolve, reject) => {
//
await this.$post(this.api.saveReferenceCategory, {
id: '',
categoryName: e.categoryName,
systemId,
level: e.level,
parentId: refId || id
}).then(async res => {
const referenceCategoryId = res.referenceCategoryId // idparentId
//
promises.push(new Promise((resolve1, reject1) => {
this.$post(this.api.sysModelDemoList, {
pageNum: 1,
pageSize: 10000,
categoryId: e.id
}).then(res => {
let { records } = res.data
records = records.filter(e => e.postStatus && !e.isOpen) //
if (records.length) {
const modelData = []
//
records.map(e => {
modelData.push({
systemId,
categoryId: referenceCategoryId,
copyId: e.id
})
})
//
this.$post(this.api.saveReferenceDemo, modelData).then(res => {
resolve()
resolve1()
}).catch(res => {
reject()
reject1()
})
} else {
resolve()
}
e.children = [...e.children, ...records]
}).catch(res => {
reject()
})
}))
//
this.$nextTick(() => {
e.children && e.children.length && addType(e.children, res.referenceCategoryId)
})
}).catch(res => {
reject()
})
}))
})
}
addType(data[0].children, id)
Promise.all(promises).then(_ => {
setTimeout(this.getType, 500)
})
}).catch(res => {})
},
//
addType(node, data) {

@ -1,9 +1,6 @@
<template>
<div>
<div>
<div style="text-align: right">
<el-button type="text" @click="addType(0)">添加</el-button>
</div>
<org-tree
:data="orgList"
default-expand-all
@ -18,6 +15,7 @@
<span style="display: inline-block; margin-right: 20px">{{ node.label }}</span>
<span>
<el-button
v-if="node.level > 1"
type="text"
icon="el-icon-edit-outline"
@click="editType(data)">
@ -28,6 +26,7 @@
@click="addType(node, data)">
</el-button>
<el-button
v-if="node.level > 1"
type="text"
icon="el-icon-delete"
@click="delType(data)">

@ -8,8 +8,8 @@
<span class="per_school" v-text="id ? '编辑更新日志' : '新增更新日志'"></span>
</div>
<div v-if="!isDetail">
<el-button type="primary" round v-preventReClick @click="submit(1)">发布</el-button>
<el-button v-if="!postStatus" type="primary" round v-preventReClick @click="submit(0)">草稿</el-button>
<el-button type="primary" round v-preventReClick @click="submit(0)">发布</el-button>
<el-button v-if="!postStatus" type="primary" round v-preventReClick @click="submit(1)">草稿</el-button>
</div>
</div>
</el-card>
@ -17,7 +17,7 @@
<el-card shadow="hover">
<el-form ref="form" label-width="120px" :disabled="isDetail">
<el-form-item label="版本标题">
<el-input placeholder="请输入版本标题" v-model="form.modelName" maxlength="30" style="width: 400px"></el-input>
<el-input placeholder="请输入版本标题" v-model="form.versionName" maxlength="30" style="width: 400px"></el-input>
</el-form-item>
<el-form-item label="封面图片">
<el-upload
@ -33,7 +33,7 @@
:headers="headers"
name="file"
>
<img v-if="coverUrl" :src="coverUrl" class="avatar">
<img v-if="form.coverUrl" :src="form.coverUrl" class="avatar">
<div class="uploader-default" v-else>
<i class="el-icon-plus"></i>
<p>上传封面</p>
@ -75,10 +75,10 @@
export default {
data() {
return {
categoryId : this.$route.query.categoryId,
id : this.$route.query.id,
form: {
modelName: '',
modelDemo: '',
versionName: '',
coverUrl: '',
content: [{}]
}
};
@ -89,11 +89,10 @@ export default {
methods: {
//
getData() {
this.$post(`${this.api.modelFindById}?id=${this.id}`).then(res => {
const { data } = res
this.form.modelName = data.modelName
this.form.modelDemo = data.modelDemo
this.codeKey++
this.$get(`${this.api.logGet}?logId=${this.id}`).then(res => {
const { log } = res
this.form.versionName = log.versionName
this.form.coverUrl = log.coverUrl
}).catch(res => {})
},
//
@ -105,25 +104,24 @@ export default {
},
//
submit(postStatus){
const { modelName, modelDemo } = this.form
submit(draft){
const { versionName, coverUrl } = this.form
const id = this.id
if (!modelName) return this.$message.error('请输入模型名称')
if (!modelDemo) return this.$message.error('请输入模型代码')
if (!versionName) return this.$message.error('请输入版本标题')
if (!coverUrl) return this.$message.error('请输入更新内容')
const data = {
categoryId: this.categoryId,
modelName,
modelDemo,
postStatus
versionName,
coverUrl,
draft
}
if (id) {
data.id = id
this.$post(this.api.updateSysModelDemo, data).then(res => {
data.logId = id
this.$post(this.api.listUpdate, data).then(res => {
this.$message.success('编辑成功')
this.$router.back()
}).catch(res => {})
} else {
this.$post(this.api.saveSysModelDemo, data).then(res => {
this.$post(this.api.logAdd, data).then(res => {
this.$message.success('新增成功')
this.$router.back()
}).catch(res => {})

@ -20,7 +20,7 @@ import log from "./log";
export default {
data() {
return {
active: "staff",
active: this.$route.query.type || 'staff',
tabs: {
staff: "后台账号",
role: "角色权限",
@ -43,7 +43,14 @@ export default {
},
methods: {
tabChange(index) {
this.active = index;
this.active = index
this.$router.push({
path: 'system',
query: {
...this.$route.query,
type: index
}
})
},
initTabs() {
let tab1 = this.auth("员工管理");

@ -11,11 +11,19 @@
<el-table :data="listData" class="table" ref="table" stripe header-align="center" row-key="id">
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="roleName" label="平台名称" align="center" min-width="250" show-overflow-tooltip></el-table-column>
<el-table-column prop="roleName" label="最新版本名称" align="center"></el-table-column>
<el-table-column prop="roleName" label="最新版本状态" align="center"></el-table-column>
<el-table-column prop="roleName" label="最近编辑" align="center"></el-table-column>
<el-table-column prop="roleName" label="版本数" align="center"></el-table-column>
<el-table-column prop="roleName" label="平台名称" align="center" min-width="250" show-overflow-tooltip>
<template slot-scope="scope">
{{ platformList.find(e => e.id === scope.row.platformId).name }}
</template>
</el-table-column>
<el-table-column prop="versionName" label="最新版本名称" align="center"></el-table-column>
<el-table-column prop="roleName" label="最新版本状态" align="center">
<template slot-scope="scope">
{{ scope.row.draft ? '草稿箱' : '已发布' }}
</template>
</el-table-column>
<el-table-column prop="updateTime" label="最近编辑" align="center"></el-table-column>
<el-table-column prop="versionNum" label="版本数" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="200">
<template slot-scope="scope">
<el-button type="text" @click="toManage(scope.row)">管理</el-button>
@ -29,12 +37,13 @@
</template>
<script>
import Setting from '@/setting'
export default {
data() {
return {
keyword: "",
searchTimer: null,
isDetail: false,
platformList: Setting.platformList,
form: {
id: "",
roleName: "",
@ -57,21 +66,20 @@ export default {
}
},
mounted() {
// this.getData();
this.getData()
},
methods: {
getData() {
this.$get(`${this.api.roleList}?page=${this.page}&size=${this.pageSize}&name=${this.keyword}&platformId=1`).then(res => {
this.listData = res.rolePage.records;
this.total = res.rolePage.total;
}).catch(res => {});
this.$get(`${this.api.logManagementList}?search=${this.keyword}`).then(res => {
this.listData = res.logManagementListVo
}).catch(res => {})
},
currentChange(val) {
this.page = val;
this.getData();
},
toManage() {
this.$router.push(`/manageLog`)
toManage(row) {
this.$router.push(`/manageLog?platformId=${row.platformId}`)
}
}
};

@ -5,7 +5,7 @@
<h6>日志更新</h6>
<div class="filter">
<label>版本查询</label>
<el-select v-model="value" size="small" placeholder="请选择版本">
<el-select v-model="versionName" size="small" placeholder="请选择版本">
<el-option
v-for="item in vers"
:key="item.value"
@ -20,14 +20,14 @@
</div>
</div>
<el-timeline class="timeline">
<el-timeline-item placement="top">
<p class="sign">2022-03-05</p>
<el-timeline-item placement="top" v-for="(item, i) in listData" :key="i">
<p class="sign">{{ item.updateTime }}</p>
<div class="ver">
<div>
职站V1.0
{{ platformList.find(e => e.id === item.platformId).name + item.versionName }}
<span class="action">
<i class="el-icon-edit-outline"></i>
<i class="el-icon-delete" @click="del"></i>
<i class="el-icon-edit-outline" @click="edit(item)"></i>
<i class="el-icon-delete" @click="del(item)"></i>
</span>
</div>
<el-switch v-model="frontShow" :active-value="0" :inactive-value="1"></el-switch>
@ -44,35 +44,42 @@
</template>
<script>
import Setting from '@/setting'
export default {
data() {
return {
vers: []
platformId: this.$route.query.platformId,
platformList: Setting.platformList,
versionName: '',
vers: [],
listData: []
};
},
mounted() {
// this.getData();
this.getData()
},
methods: {
getData() {
this.$get(`${this.api.roleList}?page=${this.page}&size=${this.pageSize}&name=${this.keyword}&platformId=1`).then(res => {
this.listData = res.rolePage.records;
this.total = res.rolePage.total;
}).catch(res => {});
this.$get(`${this.api.platformLogList}?platformId=${this.platformId}&versionName=${this.versionName}`).then(res => {
this.listData = res.logList
}).catch(res => {})
},
//
add() {
this.$router.push(`/addLog`)
},
//
edit(item) {
this.$router.push(`/addLog?id=${item.logId}`)
},
//
del(item) {
this.$confirm("确定要删除分类吗?", "提示", {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.deleteModelClass}?categoryId=${item.id}`).then(res => {
this.$post(`${this.api.logDel}?logId=${item.logId}`).then(res => {
this.$message.success("删除成功")
this.$emit("getData")
this.getType()
this.getData()
}).catch(res => {})
}).catch(() => {})
}

Loading…
Cancel
Save