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

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

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

@ -1666,8 +1666,14 @@
<el-dialog title="发货信息填写" <el-dialog title="发货信息填写"
:visible.sync="shipVisible" :visible.sync="shipVisible"
width="380px" width="380px"
class="dialog" class="ship-dia"
:close-on-click-modal="false"> :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" <el-input :disabled="viewDisabled"
v-model="shipContent" v-model="shipContent"
placeholder="请填写需交付的产品登录地址、账号、密码等内容...(300个字以内)" placeholder="请填写需交付的产品登录地址、账号、密码等内容...(300个字以内)"
@ -1676,7 +1682,19 @@
maxlength="300"></el-input> maxlength="300"></el-input>
<span slot="footer" <span slot="footer"
class="dialog-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" <el-button v-if="!viewDisabled"
type="primary" type="primary"
@click="submitShip">确定</el-button> @click="submitShip">确定</el-button>
@ -1903,6 +1921,7 @@ export default {
rate: '', rate: '',
shipVisible: false, shipVisible: false,
shipContent: '', shipContent: '',
shipInfo: '',
curRow: {}, curRow: {},
// 1 2 3 45 6 // 1 2 3 45 6
classificationId: 0, classificationId: 0,
@ -2569,6 +2588,7 @@ export default {
options: 1, options: 1,
settlementPrice: orderType === 2 ? 0 : '', // settlementPrice: orderType === 2 ? 0 : '', //
settlementPriceUnit: e.settlementPrice || 0, // settlementPriceUnit: e.settlementPrice || 0, //
mallNonAssociatedLinks: e.mallNonAssociatedLinks //
}) })
}; };
const productId = [] const productId = []
@ -2830,9 +2850,27 @@ export default {
// //
showShip (row) { showShip (row) {
this.curRow = 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 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 () { submitShip () {
this.curRow.shipContent = this.shipContent this.curRow.shipContent = this.shipContent
@ -3109,4 +3147,12 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
/deep/.ship-dia {
.el-dialog__body {
padding: 0 20px;
}
.ship {
cursor: pointer;
}
}
</style> </style>

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

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

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

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

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

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

Loading…
Cancel
Save