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

@ -14,12 +14,12 @@ 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;
@ -28,7 +28,6 @@ li {
list-style-type: none; list-style-type: none;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 8px; width: 8px;
height: 8px; height: 8px;
@ -55,8 +54,8 @@ li {
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;
} }
@ -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;
@ -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,
@ -333,12 +332,12 @@ li {
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*/
@ -382,7 +381,7 @@ li {
} }
.hr_tag { .hr_tag {
background-color: #9278FF; background-color: #9278ff;
width: 3px; width: 3px;
height: 15px; height: 15px;
margin-right: 5px; margin-right: 5px;
@ -399,20 +398,18 @@ li {
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;
@ -475,7 +472,7 @@ li {
.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>
@ -110,7 +121,9 @@ 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 => {
@ -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

@ -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>
@ -112,7 +155,8 @@ export default {
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

@ -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>
@ -155,7 +169,9 @@ export default {
// //
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
@ -248,7 +265,8 @@ 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 => {

@ -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>
@ -77,35 +133,24 @@ export default {
}, },
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 () {

@ -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>
@ -68,7 +76,8 @@ export default {
categoryName: [ categoryName: [
{ required: true, message: "请输入分类名称", trigger: "blur" } { required: true, message: "请输入分类名称", trigger: "blur" }
] ]
} },
schoolActive: 0
}; };
}, },
components: { components: {
@ -78,8 +87,11 @@ export default {
this.getType() this.getType()
}, },
methods: { methods: {
//
getType () { getType () {
this.$post(this.api.sourceModelClassification).then(res => { 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(() => {
@ -96,7 +108,9 @@ export default {
}) })
}).catch(res => { }) }).catch(res => { })
}, },
//
getSingle () { getSingle () {
this.schoolActive = 0
this.$router.push({ this.$router.push({
path: 'backstage', path: 'backstage',
query: { query: {
@ -106,6 +120,11 @@ export default {
}).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
@ -128,7 +147,8 @@ 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 => {
@ -171,5 +191,16 @@ export default {
}; };
</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