yujialong 2 years ago
parent fe898632d4
commit ff78ab0a19
  1. 125
      src/assets/css/main.css
  2. 4
      src/setting.js
  3. 1
      src/utils/api.js
  4. 52
      src/views/order/AddOrder.vue
  5. 82
      src/views/serve/addModel.vue
  6. 136
      src/views/serve/backstage/model.vue
  7. 116
      src/views/serve/backstage/modelType.vue
  8. 165
      src/views/serve/backstage/sourceModel.vue
  9. 103
      src/views/serve/backstage/sourceType.vue
  10. 46
      src/views/shop/addProduct/index.vue

@ -14,21 +14,20 @@ body,
}
body {
font-family: 'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif;
font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'microsoft yahei', arial, STHeiTi, sans-serif;
font-size: 14px;
}
a {
text-decoration: none
text-decoration: none;
}
i{
i {
font-style: normal;
}
li {
list-style-type:none;
list-style-type: none;
}
::-webkit-scrollbar {
width: 8px;
height: 8px;
@ -51,12 +50,12 @@ li {
.m-b-10 {
margin-bottom: 10px;
}
.el-table th>.cell {
.el-table th > .cell {
font-size: 14px;
}
.content-box {
-webkit-transition: left .3s ease-in-out;
transition: left .3s ease-in-out;
-webkit-transition: left 0.3s ease-in-out;
transition: left 0.3s ease-in-out;
background: #f0f0f0;
flex: 1;
}
@ -86,7 +85,7 @@ li {
color: #585858;
border-left: 3px solid #9278ff;
}
.el-upload-list{
.el-upload-list {
width: 100%;
max-width: 400px;
}
@ -115,7 +114,7 @@ li {
margin-right: 6px;
font-size: 14px;
line-height: 14px;
color: rgba(0, 0, 0, .65);
color: rgba(0, 0, 0, 0.65);
white-space: nowrap;
}
@ -123,7 +122,7 @@ li {
display: flex;
align-items: center;
padding: 0 24px;
border-bottom: 1px solid rgba(0, 0, 0, .06);
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.tabs .item {
position: relative;
@ -169,7 +168,7 @@ li {
margin-bottom: 20px;
}
.el-button+.el-tooltip {
.el-button + .el-tooltip {
margin-left: 10px;
}
@ -177,14 +176,14 @@ li {
background: #f6faff;
}
.orderTable td .el-input{
.orderTable td .el-input {
width: 60%;
}
.orderTable td .normal{
.orderTable td .normal {
width: 90%;
}
.orderTable .el-select>.el-input{
.orderTable .el-select > .el-input {
display: inline-block;
}
@ -198,7 +197,7 @@ li {
.move-enter-active,
.move-leave-active {
transition: opacity .5s;
transition: opacity 0.5s;
}
.move-enter,
@ -294,159 +293,157 @@ li {
min-height: 500px;
}
.ms-login .el-tabs__nav-wrap::after{
.ms-login .el-tabs__nav-wrap::after {
background-color: #fff;
opacity: 0;
}
.ms-login .el-tabs__item{
.ms-login .el-tabs__item {
padding: 0 90px;
color: #999;
}
.ms-login .el-tabs__item:hover{
.ms-login .el-tabs__item:hover {
color: #000;
}
.ms-login .el-tabs__item.is-active{
.ms-login .el-tabs__item.is-active {
color: #333;
font-weight: bold;
}
.ms-login .el-tabs__active-bar{
.ms-login .el-tabs__active-bar {
background-color: #000;
border-radius:2px;
border-radius: 2px;
}
.ms-login .el-tabs__nav-scroll{
.ms-login .el-tabs__nav-scroll {
display: flex;
justify-content: center;
}
.ms-login .el-input__inner{
.ms-login .el-input__inner {
height: 80px;
line-height: 80px;
border:1px solid rgba(220,220,220,1);
border-radius:2px;
border: 1px solid rgba(220, 220, 220, 1);
border-radius: 2px;
}
.el-row {
margin-bottom: 20px;
}
#app .el-table thead{
#app .el-table thead {
color: #fff;
}
#app .el-table th{
background-color: #9278FF!important;
#app .el-table th {
background-color: #9278ff !important;
font-size: 16px;
font-weight: normal;
}
.el-input__inner[type=number] {
.el-input__inner[type='number'] {
padding-right: 0;
}
/*flex*/
.flex-center{
.flex-center {
display: flex;
align-items: center;
}
.flex-c-c{
.flex-c-c {
display: flex;
align-items: center;
justify-content: center;
}
.flex-between{
.flex-between {
display: flex;
align-items: center;
justify-content: space-between;
}
.flex-around{
.flex-around {
display: flex;
align-items: center;
justify-content: space-around;
}
.flex-start-around{
.flex-start-around {
display: flex;
align-items: flex-start;
justify-content: center;
}
.flex-end-around{
.flex-end-around {
display: flex;
align-items: flex-end;
justify-content: center;
}
.flex-column{
.flex-column {
display: flex;
align-items: center;
flex-direction: column;
}
.flex-start{
.flex-start {
display: flex;
align-items: flex-start;
}
.hr_tag{
background-color: #9278FF;
.hr_tag {
background-color: #9278ff;
width: 3px;
height: 15px;
margin-right: 5px;
}
.user_header{
.user_header {
padding: 20px 0;
border-bottom: 1px dashed #eee;
}
.border-b-dashed{
.border-b-dashed {
border-bottom: 1px dashed #e3e3e3;
width: 100%;
height: 1px;
margin-bottom: 20px;
}
.shadow{
border: 0.0625rem solid #EBEEF5;
background-color: #FFF;
.shadow {
border: 0.0625rem solid #ebeef5;
background-color: #fff;
color: #303133;
-webkit-transition: .3s;
transition: .3s;
-webkit-transition: 0.3s;
transition: 0.3s;
}
.shadow :hover{
.shadow :hover {
box-shadow: 0 0.125rem 0.75rem 0 rgb(0 0 0 / 10%);
}
.flex-col{
.flex-col {
display: flex;
flex-direction: column;
}
.addhr_tag{
.addhr_tag {
background-color: #666;
width: 6px;
height: 17px;
margin-right: 5px;
}
.per_title span{
.per_title span {
font-size: 16px;
font-weight: bold;
}
.per_back{
.per_back {
margin-left: 5px;
}
.per_school{
.per_school {
margin-left: 30px;
}
.per_title:hover{
cursor:pointer;
.per_title:hover {
cursor: pointer;
}
/* 溢出省略号 */
.ellipsis{
.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.userRadio .el-radio{
margin-right: 10px!important;
.userRadio .el-radio {
margin-right: 10px !important;
}
.userRadio .el-radio__input{
display: none!important;
.userRadio .el-radio__input {
display: none !important;
}
.cursor {
cursor: pointer;
@ -469,13 +466,13 @@ li {
.el-tooltip__popper {
max-width: 500px !important;
}
.no-atTheMoment > .el-picker-panel__footer > .el-button--text:first-child{
.no-atTheMoment > .el-picker-panel__footer > .el-button--text:first-child {
display: none;
}
.tox-notifications-container {
display: none;
}
.mce-content-body:not([dir=rtl]) blockquote {
.mce-content-body:not([dir='rtl']) blockquote {
border-left: 0;
background-color: #ccc;
}

@ -11,8 +11,8 @@ if (isDev) {
jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统
host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/'
// host = 'http://192.168.31.151:9000/'// 榕
host = 'http://192.168.31.53:9000/'// 赓
host = 'http://192.168.31.152:9000/'// 榕
// host = 'http://192.168.31.53:9000/'// 赓
} else if (isPro) {
jumpPath = 'https://www.huorantech.cn/judgmentPoint/'
}

@ -125,6 +125,7 @@ export default {
updateSysModelDemo: `nakadai/nakadai/model/demo/updateSysModelDemo`,
runPythonCode: `nakadai/nakadai/model/demo/runPythonCode`,
getAllModelListBySys: `nakadai/nakadai/model/demo/getAllModelListBySys`,
InstitutionSourceModel: `nakadai/nakadai/model/demo/InstitutionSourceModel`,
// 课程管理三级联查
courseDiscipline: `nakadai/nakadai/subject/courseDiscipline`, //课程学科类别

@ -1666,8 +1666,14 @@
<el-dialog title="发货信息填写"
:visible.sync="shipVisible"
width="380px"
class="dialog"
class="ship-dia"
:close-on-click-modal="false">
<!-- <div v-if="curRow.mallNonAssociatedLinks"
class="ship">
<p class="line"
v-for="(link, i) in curRow.mallNonAssociatedLinks"
:key="i">{{ link.urlName }}{{ link.url }}</p>
</div> -->
<el-input :disabled="viewDisabled"
v-model="shipContent"
placeholder="请填写需交付的产品登录地址、账号、密码等内容...(300个字以内)"
@ -1676,7 +1682,19 @@
maxlength="300"></el-input>
<span slot="footer"
class="dialog-footer">
<el-button @click="shipVisible = false">取消</el-button>
<el-popover v-if="curRow.mallNonAssociatedLinks"
placement="bottom"
width="200"
trigger="click">
<div class="cursor"
v-html="shipInfo"
title="点击复制到文本框"
@click="copyLink"></div>
<el-button type="text"
slot="reference">产品链接</el-button>
</el-popover>
<el-button style="margin-left: 10px"
@click="shipVisible = false">取消</el-button>
<el-button v-if="!viewDisabled"
type="primary"
@click="submitShip">确定</el-button>
@ -1903,6 +1921,7 @@ export default {
rate: '',
shipVisible: false,
shipContent: '',
shipInfo: '',
curRow: {},
// 1 2 3 45 6
classificationId: 0,
@ -2569,6 +2588,7 @@ export default {
options: 1,
settlementPrice: orderType === 2 ? 0 : '', //
settlementPriceUnit: e.settlementPrice || 0, //
mallNonAssociatedLinks: e.mallNonAssociatedLinks //
})
};
const productId = []
@ -2830,9 +2850,27 @@ export default {
//
showShip (row) {
this.curRow = row
this.shipContent = row.shipContent
let val = ''
row.mallNonAssociatedLinks.forEach(e => {
val += e.urlName + ':' + e.url + '\n'
})
this.shipInfo = val
this.shipContent = row.shipContent || val
this.shipVisible = true
},
copyLink () {
// const oInput = document.createElement('input')
// oInput.value = this.shipInfo
// document.body.appendChild(oInput)
// oInput.select()
// document.execCommand('Copy')
// this.$message({
// message: '',
// type: 'success'
// })
// oInput.remove()
this.shipContent += this.shipInfo
},
//
submitShip () {
this.curRow.shipContent = this.shipContent
@ -3109,4 +3147,12 @@ export default {
text-overflow: ellipsis;
white-space: nowrap;
}
/deep/.ship-dia {
.el-dialog__body {
padding: 0 20px;
}
.ship {
cursor: pointer;
}
}
</style>

@ -1,42 +1,53 @@
<template>
<div class="wrap">
<el-card shadow="hover" class="mgb20">
<el-card shadow="hover"
class="mgb20">
<div class="flex-between">
<div class="per_title" v-preventReClick @click="back">
<div class="per_title"
v-preventReClick
@click="back">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school" v-text="isDetail ? '查看源模型' : (id ? '编辑源模型' : '新增源模型')"></span>
<span class="per_school"
v-text="isDetail ? '查看源模型' : (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(1)">发布</el-button>
<el-button v-if="!postStatus"
type="primary"
round
v-preventReClick
@click="submit(0)">草稿</el-button>
</div>
</div>
</el-card>
<el-card shadow="hover">
<el-form label-width="80px" :disabled="isDetail">
<el-form label-width="80px"
:disabled="isDetail">
<div class="item name">
<label>模型名称</label>
<el-input placeholder="请输入模型名称" v-model="form.modelName" maxlength="25" style="width: 400px"></el-input>
<el-input placeholder="请输入模型名称"
v-model="form.modelName"
maxlength="25"
style="width: 400px"></el-input>
</div>
<div class="item name">
<label>模型分类</label>
<el-cascader
:options="categoryList"
<el-cascader :options="categoryList"
v-model="categoryIdCus"
:props="categoryProps"
clearable
>
clearable>
</el-cascader>
</div>
<div class="item code">
<label>模型代码</label>
<codemirror
:key="codeKey"
<codemirror :key="codeKey"
:code.sync="form.modelDemo"
:readOnly="isDetail"
></codemirror>
:readOnly="isDetail"></codemirror>
</div>
</el-form>
</el-card>
@ -46,14 +57,14 @@
<script>
import codemirror from '@/components/codemirror'
export default {
components:{ codemirror },
data() {
components: { codemirror },
data () {
return {
categoryId : Number(this.$route.query.categoryId),
id : Number(this.$route.query.id),
postStatus : Number(this.$route.query.postStatus),
isDetail : Boolean(this.$route.query.show), //
isModel : Boolean(this.$route.query.model), //
categoryId: Number(this.$route.query.categoryId),
id: Number(this.$route.query.id),
postStatus: Number(this.$route.query.postStatus),
isDetail: Boolean(this.$route.query.show), //
isModel: Boolean(this.$route.query.model), //
categoryIdCus: [],
form: {
modelName: '',
@ -73,18 +84,18 @@ export default {
watch: {
// ,
form: {
handler(){
handler () {
this.updateTime++
},
deep:true
deep: true
},
},
mounted() {
mounted () {
this.getType()
},
methods: {
//
async getData() {
async getData () {
// /
const res = await this.$post(`${this.api[this.isModel ? 'referenceFindById' : 'modelFindById']}?id=${this.id}`)
const { data } = res
@ -97,7 +108,7 @@ export default {
this.codeKey++
},
// id
handleId(list, id, parentId = []) {
handleId (list, id, parentId = []) {
list.map(e => {
// idid
if (id === e.id) {
@ -109,8 +120,10 @@ export default {
})
},
//
getType() {
this.$post(this.api.sourceModelClassification).then(res => {
getType () {
this.$post(this.api.sourceModelClassification, {
founder: 0
}).then(res => {
const { data } = res
// children
const handleLeaf = list => {
@ -129,10 +142,10 @@ export default {
} else {
this.handleId(data, this.categoryId)
}
}).catch(res => {})
}).catch(res => { })
},
//
submit(postStatus, fromBack){
submit (postStatus, fromBack) {
if (this.submiting) return false
const { modelName, categoryId, modelDemo } = this.form
const categoryIdCus = this.categoryIdCus
@ -147,7 +160,8 @@ export default {
categoryId: categoryIdCus[categoryIdCus.length - 1],
modelName,
modelDemo,
postStatus
postStatus,
founder: 0
}
if (id) {
data.id = id
@ -167,11 +181,11 @@ export default {
}
},
//
backPage() {
backPage () {
this.$router.back()
},
//
back() {
back () {
const id = this.id
const updateTime = this.updateTime
//

@ -1,7 +1,9 @@
<template>
<div class="wrap">
<div class="side">
<org ref="tree" @initData="initData" @getData="getData"></org>
<org ref="tree"
@initData="initData"
@getData="getData"></org>
</div>
<div class="right">
@ -9,54 +11,95 @@
<div class="tool">
<ul class="filter">
<li>
<el-input placeholder="请输入模型名称" prefix-icon="el-icon-search" v-model.trim="keyword" clearable></el-input>
<el-input placeholder="请输入模型名称"
prefix-icon="el-icon-search"
v-model.trim="keyword"
clearable></el-input>
</li>
</ul>
<div>
<el-button type="primary" round @click="add">导入模型</el-button>
<el-button type="primary" round @click="batchDel">批量移除</el-button>
<el-button type="primary"
round
@click="add">导入模型</el-button>
<el-button type="primary"
round
@click="batchDel">批量移除</el-button>
</div>
</div>
<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="modelName" label="模型名称" align="center"></el-table-column>
<el-table-column v-if="isTopLevel" prop="categoryName" label="分类" width="150" align="center"></el-table-column>
<el-table-column prop="createTime" label="导入时间" align="center"></el-table-column>
<el-table-column label="状态" align="center">
<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="modelName"
label="模型名称"
align="center"></el-table-column>
<el-table-column v-if="isTopLevel"
prop="categoryName"
label="分类"
width="150"
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">
<el-table-column label="操作"
width="200"
align="center">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)">查看</el-button>
<el-button type="text" @click="del(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>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :current-page="page" @current-change="handleCurrentChange" :total="total"></el-pagination>
<el-pagination background
layout="total, prev, pager, next"
:current-page="page"
@current-change="handleCurrentChange"
:total="total"></el-pagination>
</div>
</div>
<el-dialog title="请选择需要导入的模型" :visible.sync="modelVisible" width="500px" class="dialog" :close-on-click-modal="false">
<el-dialog title="请选择需要导入的模型"
:visible.sync="modelVisible"
width="500px"
class="dialog"
:close-on-click-modal="false">
<div class="model-wrap">
<el-tree
v-if="modelData.length"
:data="modelData" v-loading="modelLoading"
<el-tree v-if="modelData.length"
:data="modelData"
v-loading="modelLoading"
ref="model"
default-expand-all
show-checkbox
node-key="id"
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}">
</el-tree>
<div class="none" v-else>暂无可导入的模型</div>
<div class="none"
v-else>暂无可导入的模型</div>
</div>
<span slot="footer" class="dialog-footer">
<span slot="footer"
class="dialog-footer">
<el-button @click="modelVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
<el-button type="primary"
@click="submit"> </el-button>
</span>
</el-dialog>
</div>
@ -64,7 +107,7 @@
<script>
import org from "./modelType"
export default {
data() {
data () {
return {
systemId: this.$route.query.systemId,
isTopLevel: true, //
@ -84,16 +127,16 @@ export default {
org
},
watch: {
keyword: function(val) {
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted() {},
mounted () { },
methods: {
getData() {
getData () {
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() //
this.isTopLevel = !curNode.level && curNode.categoryName === '全部'
//
@ -106,26 +149,27 @@ export default {
}).then(res => {
this.listData = res.data.records
this.total = res.data.total
}).catch(res => {})
}).catch(res => { })
} else {
this.$post(this.api.referenceDemoList, {
modelName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
categoryId: curNode.id
categoryId: curNode.id,
founder: 0
}).then(res => {
this.listData = res.data.records
this.total = res.data.total
}).catch(res => {})
}).catch(res => { })
}
},
initData() {
initData () {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},
//
add() {
add () {
if (!this.$refs.tree.orgList.length) return this.$message.error('请先添加模型分类')
if (this.isTopLevel) return this.$message.error('请选择子分类进入导入模型')
this.modelVisible = true
@ -145,7 +189,7 @@ export default {
const addType = list => {
list.map((e, i) => {
// promise
promises.push(new Promise((resolve,reject) => {
promises.push(new Promise((resolve, reject) => {
//
this.$post(this.api.sysModelDemoList, {
pageNum: 1,
@ -191,32 +235,32 @@ export default {
data = handleType(data)
this.modelData = (data.length && data[0].children && data[0].children.length) ? data : []
this.modelLoading = false
}).catch(res => {})
}).catch(res => {})
}).catch(res => {})
}).catch(res => { })
}).catch(res => { })
}).catch(res => { })
},
//
//
show(row) {
show (row) {
this.$router.push(`/addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${row.id}&show=1&model=1`)
},
//
del(row) {
del (row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.deleteReferenceDemo, [row.id]).then(res => {
this.$message.success("删除成功")
this.getData()
}).catch(res => {})
}).catch(() => {})
}).catch(res => { })
}).catch(() => { })
},
handleSelectionChange(val) {
handleSelectionChange (val) {
this.multipleSelection = val
},
//
batchDel() {
batchDel () {
if (this.multipleSelection.length) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
@ -226,13 +270,13 @@ export default {
this.$refs.table.clearSelection()
this.$message.success("删除成功")
this.getData()
}).catch(res => {})
}).catch(() => {})
}).catch(res => { })
}).catch(() => { })
} else {
this.$message.error("请先选择模型 !")
}
},
handleCurrentChange(val) {
handleCurrentChange (val) {
this.page = val
this.$router.push({
path: 'backstage',
@ -244,7 +288,7 @@ export default {
this.getData()
},
//
submit() {
submit () {
if (this.submiting) return false
const data = []
const systemId = this.systemId
@ -294,7 +338,7 @@ export default {
padding: 24px;
}
}
.el-input__inner{
.el-input__inner {
height: 32px;
}
.model-wrap {

@ -2,14 +2,20 @@
<div>
<div>
<div class="front-switch">
<el-switch v-model="modelIsShow" :active-value="0" :inactive-value="1" active-text="内置模型按钮前台展示" @change="changeModelStatus"></el-switch>
<el-switch v-model="modelIsShow"
:active-value="0"
:inactive-value="1"
active-text="内置模型按钮前台展示"
@change="changeModelStatus"></el-switch>
</div>
<div class="flex-between m-b-20">
<el-button type="text" icon="el-icon-refresh" @click="syncModel">同步原始模型列表</el-button>
<el-button type="text" @click="addType(0)">添加</el-button>
<el-button type="text"
icon="el-icon-refresh"
@click="syncModel">同步原始模型列表</el-button>
<el-button type="text"
@click="addType(0)">添加</el-button>
</div>
<org-tree
v-if="orgList.length"
<org-tree v-if="orgList.length"
:data="orgList"
default-expand-all
ref="tree"
@ -17,41 +23,49 @@
highlight-current
:expand-on-click-node="false"
@node-click="getSingle"
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}">
<span class="custom-tree-node"
slot-scope="{ node, data }">
<span style="display: inline-block; margin-right: 20px">{{ node.label }}</span>
<span>
<el-button
type="text"
<el-button type="text"
icon="el-icon-edit-outline"
@click="editType(data)">
</el-button>
<el-button
type="text"
<el-button type="text"
icon="el-icon-circle-plus-outline"
@click="addType(node, data)">
</el-button>
<el-button
type="text"
<el-button type="text"
icon="el-icon-delete"
@click="delType(data)">
</el-button>
</span>
</span>
</org-tree>
<div class="none" v-else>暂无数据请点击添加按钮添加模型分类</div>
<div class="none"
v-else>暂无数据请点击添加按钮添加模型分类</div>
</div>
<el-dialog :title="Form.id ? '编辑分类' : '新增分类'" :visible.sync="typeVisible" width="24%" center @close="closeDia" :close-on-click-modal="false">
<el-form ref="Form" :model="Form" :rules="rules">
<el-dialog :title="Form.id ? '编辑分类' : '新增分类'"
:visible.sync="typeVisible"
width="24%"
center
@close="closeDia"
:close-on-click-modal="false">
<el-form ref="Form"
:model="Form"
:rules="rules">
<el-form-item prop="categoryName">
<el-input placeholder="请输入分类名称" v-model="Form.categoryName"></el-input>
<el-input placeholder="请输入分类名称"
v-model="Form.categoryName"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<span slot="footer"
class="dialog-footer">
<el-button @click="typeVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
<el-button type="primary"
@click="submit"> </el-button>
</span>
</el-dialog>
</div>
@ -60,7 +74,7 @@
import OrgTree from "@/components/org-tree/src/tree";
export default {
props: ["Data"],
data() {
data () {
return {
systemId: this.$route.query.systemId,
modelIsShow: false,
@ -82,13 +96,13 @@ export default {
components: {
OrgTree
},
mounted() {
mounted () {
this.getType()
this.getModelStatus()
},
methods: {
//
getType() {
getType () {
this.$post(`${this.api.modelClassList}?systemId=${this.systemId}`).then(res => {
const { data } = res
this.orgList = data
@ -101,32 +115,32 @@ export default {
...this.$route.query,
categoryId: this.$refs.tree.getCurrentKey()
}
}).catch(err => {})
}).catch(err => { })
this.$emit('getData')
})
}).catch(res => {})
}).catch(res => { })
},
//
getModelStatus() {
getModelStatus () {
this.$post(`${this.api.checkIsShowBySystemId}?systemId=${this.systemId}`).then(res => {
this.modelIsShow = res.isShow // 0 1
}).catch(res => {})
}).catch(res => { })
},
//
changeModelStatus(val) {
this.$post(`${this.api.modifyIsShowState}?systemId=${this.systemId}&isShow=${val}`).then(res => {}).catch(res => {})
changeModelStatus (val) {
this.$post(`${this.api.modifyIsShowState}?systemId=${this.systemId}&isShow=${val}`).then(res => { }).catch(res => { })
},
getSingle() {
getSingle () {
this.$router.push({
path: 'backstage',
query: {
...this.$route.query,
categoryId: this.$refs.tree.getCurrentKey()
}
}).catch(err => {})
}).catch(err => { })
this.$emit('initData')
},
syncModelData() {
syncModelData () {
//
this.$post(`${this.api.delModelInfoBySystemId}?systemId=${this.systemId}`).then(res => {
this.$post(`${this.api.synchronizationMdel}?systemId=${this.systemId}`).then(res => {
@ -139,23 +153,25 @@ export default {
})
this.getType()
})
}).catch(() => {})
}).catch(() => { })
},
syncModel() {
syncModel () {
if (this.orgList.length) {
this.$confirm('同步后当前的组织架构将会被删除,是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.syncModelData()
}).catch(() => {})
}).catch(() => { })
} else {
this.syncModelData()
}
},
//
async addData(id) {
async addData (id) {
//
this.$post(this.api.sourceModelClassification).then(res => {
this.$post(this.api.sourceModelClassification, {
founder: 0
}).then(res => {
const { data } = res
const systemId = this.systemId
const promises = []
@ -170,7 +186,8 @@ export default {
categoryName: e.categoryName,
systemId,
level: e.level,
parentId: refId || id
parentId: refId || id,
founder: 0
}).then(async res => {
const referenceCategoryId = res.referenceCategoryId // idparentId
@ -224,23 +241,23 @@ export default {
Promise.all(promises).then(_ => {
setTimeout(this.getType, 500)
})
}).catch(res => {})
}).catch(res => { })
},
//
addType(node, data) {
addType (node, data) {
this.typeVisible = true
this.Form.parentId = data ? data.id : 0
this.Form.level = node ? node.level : 0
},
//
editType(data) {
editType (data) {
this.Form.id = data.id
this.Form.parentId = data ? data.parentId : 0
this.Form.categoryName = data.categoryName
this.typeVisible = true
},
//
submit() {
submit () {
this.$refs['Form'].validate((valid) => {
if (valid) {
const form = this.Form
@ -248,26 +265,27 @@ export default {
id: form.id,
parentId: form.parentId,
categoryName: form.categoryName,
systemId: this.systemId
systemId: this.systemId,
founder: 0
}
if (data.id) {
this.$post(this.api.updateModelClass, data).then(res => {
this.$message.success("编辑成功")
this.typeVisible = false
this.getType()
}).catch(res => {})
}).catch(res => { })
} else {
data.level = form.level
this.$post(this.api.saveReferenceCategory, data).then(res => {
this.$message.success("添加成功")
this.typeVisible = false
this.getType()
}).catch(res => {})
}).catch(res => { })
}
}
})
},
closeDia() {
closeDia () {
this.$refs.Form.resetFields()
this.Form = {
id: '',
@ -276,7 +294,7 @@ export default {
}
},
//
delType(item) {
delType (item) {
this.$confirm("确定要删除分类吗?", "提示", {
type: "warning"
}).then(() => {
@ -284,8 +302,8 @@ export default {
this.$message.success("删除成功")
this.$emit('initData')
this.getType()
}).catch(res => {})
}).catch(() => {})
}).catch(res => { })
}).catch(() => { })
}
}
};

@ -1,7 +1,9 @@
<template>
<div class="wrap">
<div class="side">
<org ref="tree" @initData="initData" @getData="getData"></org>
<org ref="tree"
@initData="initData"
@getData="getData"></org>
</div>
<div class="right">
@ -9,40 +11,94 @@
<div class="tool">
<ul class="filter">
<li>
<el-input placeholder="请输入模型名称" prefix-icon="el-icon-search" v-model.trim="keyword" clearable></el-input>
<el-input placeholder="请输入模型名称"
prefix-icon="el-icon-search"
v-model.trim="keyword"
clearable></el-input>
</li>
</ul>
<div>
<el-button type="primary" round @click="add">新增模型</el-button>
<el-button type="primary" round @click="batchDel">批量删除</el-button>
<el-button type="primary" round @click="batchOff(1)">批量禁用</el-button>
<el-button type="primary" round @click="batchOff(0)">批量开启</el-button>
<el-button type="primary"
round
@click="add">新增模型</el-button>
<el-button type="primary"
round
@click="batchDel">批量删除</el-button>
<el-button type="primary"
round
@click="batchOff(1)">批量禁用</el-button>
<el-button type="primary"
round
@click="batchOff(0)">批量开启</el-button>
</div>
</div>
<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="modelName" label="模型名称" align="center"></el-table-column>
<el-table-column v-if="isTopLevel" prop="categoryName" label="分类" width="150" align="center"></el-table-column>
<el-table-column prop="modifyName" label="编辑人" align="center"></el-table-column>
<el-table-column prop="updateTime" label="最新编辑时间" width="150" align="center"></el-table-column>
<el-table-column prop="workNumber" label="状态" width="100" align="center">
<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="modelName"
label="模型名称"
align="center"></el-table-column>
<el-table-column v-if="isTopLevel"
prop="categoryName"
label="分类"
width="150"
align="center"></el-table-column>
<el-table-column prop="modifyName"
label="编辑人"
align="center">
<template slot-scope="scope">
{{ scope.row.schoolName || scope.row.modifyName }}
</template>
</el-table-column>
<el-table-column prop="updateTime"
label="最新编辑时间"
width="150"
align="center"></el-table-column>
<el-table-column prop="workNumber"
label="状态"
width="100"
align="center">
<template slot-scope="scope">
{{ scope.row.postStatus ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column label="操作" width="230">
<el-table-column label="操作"
width="230">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)">查看</el-button>
<el-button type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="del(scope.row)">删除</el-button>
<el-switch v-if="scope.row.postStatus" v-model="scope.row.isOpen" :active-value="0" :inactive-value="1" style="margin: 0 10px 0 5px" :active-text="scope.row.isOpen ? '禁用' : '启用'" @change="switchOff($event,scope.row,scope.$index)"></el-switch>
<el-button type="text"
@click="show(scope.row)">查看</el-button>
<el-button type="text"
@click="edit(scope.row)">编辑</el-button>
<el-button type="text"
@click="del(scope.row)">删除</el-button>
<el-switch v-if="scope.row.postStatus"
v-model="scope.row.isOpen"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
:active-text="scope.row.isOpen ? '禁用' : '启用'"
@change="switchOff($event,scope.row,scope.$index)"></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :current-page="page" @current-change="handleCurrentChange" :total="total"></el-pagination>
<el-pagination background
layout="total, prev, pager, next"
:current-page="page"
@current-change="handleCurrentChange"
:total="total"></el-pagination>
</div>
</div>
</div>
@ -50,7 +106,7 @@
<script>
import org from "./sourceType"
export default {
data() {
data () {
return {
isTopLevel: true, //
listData: [],
@ -65,54 +121,43 @@ export default {
org
},
watch: {
keyword: function(val) {
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted() {
mounted () {
},
methods: {
//
getData() {
async getData (school) {
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() //
this.isTopLevel = !curNode.level
//
if (!curNode.level) {
this.$post(this.api.getAllModelListBySys, {
modelName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize
}).then(res => {
this.listData = res.data.records
this.total = res.data.total
}).catch(res => {})
} else {
this.$post(this.api.sysModelDemoList, {
const { data } = await this.$post(this.api[school ? 'InstitutionSourceModel' : !curNode.level ? 'getAllModelListBySys' : 'sysModelDemoList'], {
modelName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
categoryId: curNode.id
}).then(res => {
this.listData = res.data.records
this.total = res.data.total
}).catch(res => {})
}
categoryId: curNode.id,
founder: 0
})
this.listData = data.records
this.total = data.total
},
initData() {
initData (school) {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
this.getData(school)
},
//
add() {
add () {
this.$router.push(`/addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}`)
},
//
batchDel() {
batchDel () {
if (this.multipleSelection.length) {
//
let ids = this.multipleSelection.map(e => e.id)
@ -122,14 +167,14 @@ export default {
this.$post(this.api.deleteSysModelDemo, ids).then(res => {
this.$message.success('删除成功')
this.getData()
}).catch(res => {})
}).catch(() => {})
}).catch(res => { })
}).catch(() => { })
} else {
this.$message.error("请先选择模型 !")
}
},
//
batchOff(isOpen) {
batchOff (isOpen) {
const off = isOpen === 0
if (this.multipleSelection.length) {
//
@ -140,39 +185,39 @@ export default {
this.$post(`${this.api.bulkDisable}?isOpen=${isOpen}`, ids).then(res => {
this.$message.success(`${off ? '启用' : '禁用'}成功`)
this.getData()
}).catch(res => {})
}).catch(() => {})
}).catch(res => { })
}).catch(() => { })
} else {
this.$message.error("请先选择模型 !")
}
},
//
show(row) {
show (row) {
this.$router.push(`/addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${row.id}&show=1`)
},
//
edit(row) {
edit (row) {
this.$router.push(`/addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${row.id}&postStatus=${row.postStatus}`)
},
del(row) {
del (row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.deleteSysModelDemo, [row.id]).then(res => {
this.$message.success('删除成功')
this.getData()
}).catch(res => {})
}).catch(() => {})
}).catch(res => { })
}).catch(() => { })
},
switchOff(val,row,index) {
switchOff (val, row, index) {
this.$post(`${this.api.bulkDisable}?isOpen=${val}`, [row.id]).then(res => {
this.$message.success(val ? '禁用成功' : '启用成功')
}).catch(res => {})
}).catch(res => { })
},
handleSelectionChange(val) {
handleSelectionChange (val) {
this.multipleSelection = val
},
handleCurrentChange(val) {
handleCurrentChange (val) {
this.page = val
this.$router.push({
path: 'backstage',
@ -201,7 +246,7 @@ export default {
padding: 24px;
}
}
.el-input__inner{
.el-input__inner {
height: 32px;
}
</style>

@ -1,32 +1,28 @@
<template>
<div>
<div>
<org-tree
:data="orgList"
<org-tree :data="orgList"
default-expand-all
ref="tree"
node-key="id"
highlight-current
:expand-on-click-node="false"
@node-click="getSingle"
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}">
<span class="custom-tree-node"
slot-scope="{ node, data }">
<span style="display: inline-block; margin-right: 20px">{{ node.label }}</span>
<span>
<el-button
v-if="node.level > 1"
<el-button v-if="node.level > 1"
type="text"
icon="el-icon-edit-outline"
@click="editType(data)">
</el-button>
<el-button
type="text"
<el-button type="text"
icon="el-icon-circle-plus-outline"
@click="addType(node, data)">
</el-button>
<el-button
v-if="node.level > 1"
<el-button v-if="node.level > 1"
type="text"
icon="el-icon-delete"
@click="delType(data)">
@ -34,17 +30,29 @@
</span>
</span>
</org-tree>
<div :class="['school-create', {active: schoolActive}]"
@click="schoolClick">院校创建</div>
</div>
<el-dialog :title="Form.id ? '编辑分类' : '新增分类'" :visible.sync="typeVisible" width="24%" center @close="closeDia" :close-on-click-modal="false">
<el-form ref="Form" :model="Form" :rules="rules">
<el-dialog :title="Form.id ? '编辑分类' : '新增分类'"
:visible.sync="typeVisible"
width="24%"
center
@close="closeDia"
:close-on-click-modal="false">
<el-form ref="Form"
:model="Form"
:rules="rules">
<el-form-item prop="categoryName">
<el-input placeholder="请输入分类名称" v-model="Form.categoryName"></el-input>
<el-input placeholder="请输入分类名称"
v-model="Form.categoryName"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<span slot="footer"
class="dialog-footer">
<el-button @click="typeVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
<el-button type="primary"
@click="submit"> </el-button>
</span>
</el-dialog>
</div>
@ -53,7 +61,7 @@
import OrgTree from "@/components/org-tree/src/tree";
export default {
props: ["Data"],
data() {
data () {
return {
systemId: this.$route.query.systemId,
orgList: [],
@ -68,18 +76,22 @@ export default {
categoryName: [
{ required: true, message: "请输入分类名称", trigger: "blur" }
]
}
},
schoolActive: 0
};
},
components: {
OrgTree
},
mounted() {
mounted () {
this.getType()
},
methods: {
getType() {
this.$post(this.api.sourceModelClassification).then(res => {
//
getType () {
this.$post(this.api.sourceModelClassification, {
founder: 0
}).then(res => {
const { data } = res
this.orgList = data
data.length && this.$nextTick(() => {
@ -91,36 +103,43 @@ export default {
...this.$route.query,
categoryId: this.$refs.tree.getCurrentKey()
}
}).catch(err => {})
}).catch(err => { })
this.$emit('getData')
})
}).catch(res => {})
}).catch(res => { })
},
getSingle() {
//
getSingle () {
this.schoolActive = 0
this.$router.push({
path: 'backstage',
query: {
...this.$route.query,
categoryId: this.$refs.tree.getCurrentKey()
}
}).catch(err => {})
}).catch(err => { })
this.$emit('initData')
},
//
schoolClick () {
this.schoolActive = 1
this.$emit('initData', 1)
},
//
addType(node, data) {
addType (node, data) {
this.typeVisible = true
this.Form.parentId = data ? data.id : 0
this.Form.level = node ? node.level : 0
},
//
editType(data) {
editType (data) {
this.Form.id = data.id
this.Form.parentId = data ? data.parentId : 0
this.Form.categoryName = data.categoryName
this.typeVisible = true
},
//
submit() {
submit () {
this.$refs['Form'].validate((valid) => {
if (valid) {
const form = this.Form
@ -128,26 +147,27 @@ export default {
id: form.id,
parentId: form.parentId,
categoryName: form.categoryName,
systemId: this.systemId
systemId: this.systemId,
founder: 0
}
if (data.id) {
this.$post(this.api.updateSourceModelCategory, data).then(res => {
this.$message.success("编辑成功")
this.typeVisible = false
this.getType()
}).catch(res => {})
}).catch(res => { })
} else {
data.level = form.level
this.$post(this.api.categorySave, data).then(res => {
this.$message.success("添加成功")
this.typeVisible = false
this.getType()
}).catch(res => {})
}).catch(res => { })
}
}
})
},
closeDia() {
closeDia () {
this.$refs.Form.resetFields()
this.Form = {
id: '',
@ -156,7 +176,7 @@ export default {
}
},
//
delType(item) {
delType (item) {
this.$confirm("确定要删除分类吗?", "提示", {
type: "warning"
}).then(() => {
@ -164,12 +184,23 @@ export default {
this.$message.success("删除成功")
this.$emit('initData')
this.getType()
}).catch(res => {})
}).catch(() => {})
}).catch(res => { })
}).catch(() => { })
}
}
};
</script>
<style lang="scss" scoped>
.school-create {
padding: 3px 5px 3px 23px;
margin-top: 5px;
font-size: 14px;
cursor: pointer;
&.active {
background-color: #f0f7ff;
}
&:hover {
background-color: #f0f7ff;
}
}
</style>

@ -107,7 +107,7 @@
:key="i"
:label="item.classificationName"
:value="item.classificationId"
:disabled="form.mall.isAssociatedProduct && (item.classificationId !== 4 && item.classificationId !== 6)"></el-option>
:disabled="!!(form.mall.isAssociatedProduct && (item.classificationId !== 4 && item.classificationId !== 6))"></el-option>
</el-select>
</el-form-item>
<el-form-item class="req"
@ -278,7 +278,7 @@
prop="miniProgramPictureAddress">
<el-upload class="avatar-uploader"
accept=".jpg,.png,.jpeg"
:before-remove="beforeMiniRemove"
:on-remove="handleMiniRemove"
:on-success="uploadSuccessMini"
:limit="1"
:action="api.fileupload"
@ -500,7 +500,8 @@
</el-form-item>
<el-form-item prop="file"
label="产品参数">
<el-upload :before-remove="beforeFileRemove"
<el-upload :before-remove="beforeRemove"
:on-remove="handleFileRemove"
:on-success="uploadSuccessFile"
:action="api.fileUploadNakadai"
:file-list="form.mallAnnex"
@ -593,14 +594,19 @@
<li>操作</li>
</ul>
<el-tree class="sort"
:indent="0"
:data="labels"
node-key="id"
node-key="tagsId"
default-expand-all
draggable>
draggable
:allow-drop="allowDrop"
@node-drag-end="handleDrop">
<ul class="sort-line"
slot-scope="{ node, data }">
<li>{{ data.index + 1 }}</li>
<li>
<i class="el-icon-rank"></i>
{{ data.index + 1 }}
</li>
<li>
<el-input v-if="data.edit"
placeholder="请输入主题名称"
@ -699,7 +705,6 @@ import quill from "@/components/quill";
import Editor from '@tinymce/tinymce-vue'
import editorConfig from '@/utils/editor'
export default {
name: "courseAddEdit",
data () {
return {
headers: {
@ -811,7 +816,6 @@ export default {
// ,
form: {
handler (val) {
console.log("🚀 ~ file: index.vue:511 ~ handler ~ val:", val)
this.updateTime++
},
deep: true
@ -1120,6 +1124,15 @@ export default {
this.labelVisible = false
}
},
allowDrop (draggingNode, dropNode, type) {
if (dropNode.level == 1 && type === 'inner') return false
return true
},
handleDrop () {
this.labels.forEach((e, i) => {
e.index = i
})
},
//
sortLabel () {
const list = this.labels
@ -1345,7 +1358,7 @@ export default {
uploadSuccessMini (res) {
this.form.mall.appletIcon = res.data.filesResult.fileUrl;
},
beforeMiniRemove () {
handleMiniRemove () {
this.form.mall.appletIcon = ''
},
uploadSuccessInterface (res) { //
@ -1353,15 +1366,18 @@ export default {
},
uploadSuccessFile (res) { //
const e = res.filesResult
this.form.mallAnnex = [{
this.form.mallAnnex.push({
mallId: this.id,
filePath: e.fileUrl,
fileName: e.originalFileName,
name: e.originalFileName,
}]
})
},
beforeFileRemove () {
this.form.mallAnnex = []
beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleFileRemove (file, fileList) {
this.form.mallAnnex = fileList
},
//
beforeUpload () {
@ -1668,7 +1684,7 @@ $avatar-width: 104px;
&:nth-child(2) {
position: absolute;
width: 280px;
left: 100px;
left: 105px;
}
&:last-child {
position: absolute;

Loading…
Cancel
Save