审核更新

master
lion 11 months ago
parent 237d9fe1f7
commit 8829939e12

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= webpackConfig.name %></title>
<script src="tinymce/tinymce.min.js"></script>
<!-- <script src="tinymce/tinymce.min.js"></script> -->
<!-- <script>
window._AMapSecurityConfig = {
securityJsCode: '0d59d0a3fa5483849b52b0edc4bc97ec',

@ -55,6 +55,14 @@ export function destroy(params) {
})
}
export function batchSort(data) {
return request({
method: "post",
url: "/api/admin/product-category-applications/batch-sort",
data
})
}

@ -55,6 +55,14 @@ export function destroy(params) {
})
}
export function phaseDel(params) {
return request({
method: "get",
url: "/api/admin/product-category/phase-destroy",
params
})
}

@ -486,49 +486,41 @@ export default {
enter-active-class="slide-in-bottom"
leave-to-class="slide-out-down"
>
<Page
page-size-opts={this.pageSizeOpts}
show-total={true}
page-size={this.pageSize}
v-show={this.isShowPage}
total={
<el-pagination
page-sizes={this.pageSizeOpts}
page-size={this.pageSize}
currentPage={this.selectOpt.page}
background
layout="total, sizes, prev, pager, next, jumper"
total={
this.action
? this.totalData || this.listData.length
: this.total
}
size="small"
// show-elevator={true}
// show-sizer={this.showSizer}
class="xy-table__page"
on={{
["on-page-size-change"]: (e) => {
if (this.action) {
this.selectOpt.page_size = e;
}
class="xy-table__page"
on={{
['update:currentPage']:(newval)=>{
this.selectOpt.page = newval
},
["size-change"]: (e) => {
if (this.action) {
this.selectOpt.page_size = e;
this.selectOpt.page = 1;
this.getTableData();
}
this.selectOpt.page = 1;
this.getTableData();
}
this.$emit("pageSizeChange", e);
},
["on-change"]: (e) => {
if (this.action) {
this.selectOpt.page = e;
this.getTableData();
}
this.$emit("pageIndexChange", e);
},
}}
scopedSlots={{
default: () => {
return (
<span>
A total of {this.action
? this.totalData || this.listData.length
: this.total} items
</span>
);
},
}}
></Page>
this.$emit("pageSizeChange", e);
},
["current-change"]: (e) => {
if (this.action) {
this.selectOpt.page = e;
this.getTableData();
}
this.$emit("pageIndexChange", e);
},
}}>
</el-pagination>
</transition>
<el-popover

@ -1,6 +1,6 @@
<template>
<div class="tinymce">
<Editor v-model="myValue" :id="keyid" :init="init" :disabled="disabled"></Editor>
<Editor v-model="myValue" :init="init" :disabled="disabled"></Editor>
</div>
</template>
@ -29,7 +29,25 @@
import "tinymce/icons/default"
import 'tinymce/plugins/code'
import "tinymce/plugins/image"
import "tinymce/plugins/imagetools"
import "tinymce/plugins/imagetools"
import 'tinymce/themes/silver/theme'
import "tinymce/plugins/searchreplace"
import "tinymce/plugins/template"
import "tinymce/plugins/directionality"
import "tinymce/plugins/paste"
import "tinymce/plugins/preview"
import "tinymce/plugins/visualchars"
import "tinymce/plugins/charmap"
import "tinymce/plugins/anchor"
import "tinymce/plugins/codesample"
import "tinymce/plugins/pagebreak"
import "tinymce/plugins/nonbreaking"
import "tinymce/plugins/advlist"
import "tinymce/plugins/emoticons"
import "tinymce/plugins/insertdatetime"
import "tinymce/plugins/autosave"
// import "/public/tinymce/plugins/axupimgs/plugin.js"
export default {
components: {
@ -43,26 +61,28 @@
value: {
type: String,
default: "",
},
keyid:{
type: String,
default: "tinymce",
},
disabled: {
type: Boolean,
default: false,
},
plugins: {
type: [String, Array],
type: [String, Array],
// axupimgs
default: "code image paste preview searchreplace autolink directionality visualblocks visualchars fullscreen template codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave ",
default: "code image autolink visualblocks fullscreen table hr lists wordcount imagetools textpattern help",
// default: "code image paste preview searchreplace autolink directionality visualblocks visualchars fullscreen template codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave ",
},
toolbar: {
type: [String, Array],
type: [String, Array],
// axupimgs
default: ` undo redo restoredraft | code | image | imagetools | assignment | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough anchor | alignleft aligncenter alignright alignjustify outdent indent |
styleselect formatselect fontselect fontsizeselect | table charmap emoticons hr pagebreak | bullist numlist | blockquote subscript superscript removeformat |
insertdatetime print preview | fullscreen | bdmap indent2em lineheight formatpainter`,
default: ` undo redo restoredraft | code | image | imagetools | assignment | cut copy | forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright alignjustify outdent indent |
styleselect formatselect fontselect fontsizeselect | table hr | bullist numlist | blockquote subscript superscript removeformat |
print | fullscreen | bdmap indent2em lineheight formatpainter`,
// default: ` undo redo restoredraft | code | image | imagetools | assignment | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough anchor | alignleft aligncenter alignright alignjustify outdent indent |
// styleselect formatselect fontselect fontsizeselect | table charmap emoticons hr pagebreak | bullist numlist | blockquote subscript superscript removeformat |
// insertdatetime print preview | fullscreen | bdmap indent2em lineheight formatpainter`,
},
menubar: {
type: String,
@ -70,14 +90,16 @@
},
},
data() {
var random = Math.round(Math.random() * 5000)
return {
myValue: this.value,
showImg: false,
// tinymceId:,'tinymceId' + random
imgUploadUrl: `${process.env.VUE_APP_UPLOAD_API}`,
init: {
// language_url: "/public/tinymce/langs/zh_CN.js", //
// language: "zh_CN",
selector:`#${this.keyid}`,
// language: "zh_CN",
// selector:`#${this.keyid}`,
// selector: "#textarea",
height: this.height,
plugins: this.plugins,
@ -85,8 +107,9 @@
toolbar: this.toolbar,
branding: false,
menubar: this.menubar,
inline: false,
//
images_upload_url: this.imgUploadUrl,
images_upload_url: `${process.env.VUE_APP_UPLOAD_API}`,
images_upload_handler: (blobInfo, success, failure) => {
this.handleImgUpload(blobInfo, success, failure);
},
@ -120,6 +143,9 @@
mounted() {
tinymce.init({});
},
beforeDestroy() {
// tinymce.destroy();
},
watch: {
value(newValue) {
this.myValue = newValue;

@ -9,6 +9,7 @@ export default{
brandList: [],
topicList: [],
equipmentList:[],
tagsList:[]
}
},
@ -35,7 +36,7 @@ export default{
})
},
getResourcePara(){
let number = ['topic','equipment']
let number = ['topic','equipment','tag']
getparameter({
number: number,
type:2
@ -48,6 +49,9 @@ export default{
if(item.number==='equipment'){
this.equipmentList = item.detail
}
if(item.number==='tag'){
this.tagsList = item.detail
}
})
})
}

@ -38,7 +38,7 @@ export default{
})
},
getResourcePara(){
let number = ['catalogTypeList','specificSampleList']
let number = ['catalogTypeList']
getparameter({
number: number,
type:3

@ -11,65 +11,100 @@
<el-input placeholder="Please Input" style="width:100%" v-model="form.name"></el-input>
</div>
</div>
</template>
<template v-slot:sort>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>Sort
</div>
<div class="xy-table-item-content">
<el-input placeholder="Please Input" style="width:100%" v-model="form.sort"></el-input>
</div>
</div>
</template>
<template v-slot:type>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>Sample Type
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" v-model="form.type" placeholder="Please Select">
<el-option v-for="item in sampleTypeList" :key="item.id" :label="item.value" :value="item.id"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:sort>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Sort
</div>
<div class="xy-table-item-content">
<el-input placeholder="Please Input" style="width:100%" v-model="form.sort"></el-input>
</div>
</div>
</template>
<template v-slot:size>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Size Exclusion
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" multiple filterable collapse-tags v-model="form.size" placeholder="Please Select">
<el-option v-for="item in productPhaseList" :key="item.id" :label="item.name" :value="item.id"></el-option>
<el-select style="width:100%" multiple filterable collapse-tags v-model="form.size"
placeholder="Please Select">
<el-option v-for="item in productPhaseList" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:lon>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Ion Exchange
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" multiple filterable collapse-tags v-model="form.lon"
placeholder="Please Select">
<el-option v-for="item in productPhaseList" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:phase>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Reversed phase
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" multiple filterable collapse-tags v-model="form.phase"
placeholder="Please Select">
<el-option v-for="item in productPhaseList" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:interaction>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Hydrophobic Interaction
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" multiple filterable collapse-tags v-model="form.interaction"
placeholder="Please Select">
<el-option v-for="item in productPhaseList" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:webinar_ids>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Webinar
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" multiple filterable collapse-tags v-model="form.webinar_ids"
placeholder="Please Select">
<el-option v-for="item in webinarList" :key="item.id" :label="item.title" :value="item.id"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:lon>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Ion Exchange
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" multiple filterable collapse-tags v-model="form.lon" placeholder="Please Select">
<el-option v-for="item in productPhaseList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:phase>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Reversed phase
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" multiple filterable collapse-tags v-model="form.phase" placeholder="Please Select">
<el-option v-for="item in productPhaseList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:interaction>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Hydrophobic Interaction
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" multiple filterable="" collapse-tags v-model="form.interaction" placeholder="Please Select">
<el-option v-for="item in productPhaseList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
</template>
</xy-dialog>
</div>
@ -79,40 +114,72 @@
import {
save,
show
} from "@/api/application/category.js"
import {
index
} from "@/api/application/category.js"
import {
index as getBaseList
} from "@/api/system/baseForm.js"
import {
index
} from "@/api/product/category.js"
export default {
data() {
return {
isShow: false,
id: '',
type: 'add',
productPhaseList:[],
type: 'add',
productPhaseList: [],
webinarList: [],
sampleTypeList: [{
id: 0,
value: 'Normal'
}, {
id: 1,
value: 'Special'
}],
form: {
name: '',
sort:0,
name: '',
type: 0,
sort: 0,
size: [],
lon: [],
phase: [],
interaction: [],
webinar_ids: []
},
rules: {
name: [{
required: true,
message: 'Please Input'
}],
type: [{
required: true,
message: 'Please Select'
}],
}
}
},
created() {
this.getProductPhase()
this.getWebList()
},
methods: {
async getProductPhase(){
const res = await index({page:1,page_size:999,type:2,sort_type: 'ASC',sort_name: 'sort'})
this.productPhaseList = res.data
methods: {
async getProductPhase() {
const res = await index({
page: 1,
page_size: 9999,
type: 2,
sort_type: 'ASC',
sort_name: 'sort'
})
this.productPhaseList = res.data
},
async getWebList() {
const res = await getBaseList({
table_name: 'webinars',
page: 1,
page_size: 9999,
})
this.webinarList = res.data
},
submit() {
if (this.id) {
@ -140,11 +207,13 @@
id: this.id,
show_relation: []
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
this.form.size= res.size?res.size:[]
this.form.lon= res.lon?res.lon:[]
this.form.phase= res.phase?res.phase:[]
this.form.interaction= res.interaction?res.interaction:[]
this.form = this.base.requestToForm(res, this.form)
this.form.type = res.type ? res.type : 0
this.form.size = res.size ? res.size : []
this.form.lon = res.lon ? res.lon : []
this.form.phase = res.phase ? res.phase : []
this.form.interaction = res.interaction ? res.interaction : [],
this.form.webinar_ids = res.webinar_ids ? res.webinar_ids : []
})
}
},
@ -157,12 +226,14 @@
} else {
this.id = ''
this.form = {
name: '',
sort:0,
size: [],
lon: [],
phase: [],
name: '',
type: 0,
sort: 0,
size: [],
lon: [],
phase: [],
interaction: [],
webinar_ids: []
}
this.$refs['dialog'].reset()
}

@ -5,7 +5,7 @@
<template v-slot:application_type_id>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>Application Category
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>Application Samples
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" filterable v-model="form.application_type_id" placeholder="Please Select">
@ -100,7 +100,21 @@
</el-select>
</div>
</div>
</template>
</template>
<template v-slot:tag_ids>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Tags
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" multiple filterable collapse-tags v-model="form.tag_ids"
placeholder="Please Select">
<el-option v-for="item in tagsList" :key="item.id" :label="item.value" :value="item.id"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:file_ids>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
@ -208,6 +222,7 @@
branch: [],
topic: [],
equipment: [],
tag_ids: [],
file_ids: '',
application_details: [],
},
@ -304,7 +319,8 @@
show_relation: ['applicationDetails']
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
this.form.application_details = res.application_details ? res.application_details : []
this.form.application_details = res.application_details ? res.application_details : [],
this.form.tag_ids = res.tag_ids?res.tag_ids:[]
if (res.files && res.files.length > 0) {
this.filesList = []
res.files.map(item => {
@ -336,6 +352,7 @@
branch: [],
topic: [],
equipment: [],
tag_ids: [],
file_ids: '',
application_details: [],
}

@ -35,8 +35,7 @@
visitLog
} from "@/api/customer";
export default {
components: {
},
components: {},
data() {
return {
select: {
@ -50,20 +49,30 @@
width: 50,
fixed: 'left'
}, {
prop: 'email',
label: 'email',
prop: 'user.email',
label: 'User Email',
align: 'left',
width: 180,
}, {
prop: 'title',
label: 'Title',
align: 'left',
width: 240,
width: 180,
}, {
prop: 'web',
label: 'Visit Web',
align: 'left'
prop: 'url',
label: 'Url',
align: 'left',
},
{
prop: 'product_category.name',
label: 'Product Phase',
align: 'left',
},
{
prop: 'Created_At',
label: 'created_at(创建时间)',
prop: 'created_at',
label: 'Access Time',
align: 'left',
width: 240
width: 180
}
]
@ -89,7 +98,8 @@
},
async getList() {
const res = await visitLog({
...this.select
...this.select,
show_relation: ['user', 'productCategory'],
})
this.list = res.data
this.total = res.total

@ -24,13 +24,55 @@
</lx-header>
</div>
</div>
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange"
@pageSizeChange="pageSizeChange" :table-item="table_item">
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange"
:table-item="table_item">
<template v-slot:product>
<el-table-column align='left' label="Product" minWidth="360" header-align="center">
<!-- <template slot-scope="scope">
<el-table :data="scope.row.order_products" style="width: 100%; margin-top: 10px;">
<el-table-column prop="name" label="订单名称"></el-table-column>
<el-table-column prop="number" label="订单日期"></el-table-column>
<el-table-column prop="total" label="金额"></el-table-column>
</el-table>
</template> -->
<el-table-column align='left' label="name" width="360" header-align="center">
<template slot-scope="scope">
<template v-if="scope.row.order_products && scope.row.order_products.length>0">
<template v-for="item in scope.row.order_products">
<div class="product-item">{{item.product.name}}</div>
</template>
</template>
</template>
</el-table-column>
<el-table-column align='left' label="number" width="360" header-align="center">
<template slot-scope="scope">
<template v-if="scope.row.order_products && scope.row.order_products.length>0">
<template v-for="item in scope.row.order_products">
<div class="product-item">{{item.product.number}}</div>
</template>
</template>
</template>
</el-table-column>
<el-table-column align='left' label="total" width="120" header-align="center">
<template slot-scope="scope">
<template v-if="scope.row.order_products && scope.row.order_products.length>0">
<template v-for="item in scope.row.order_products">
<div class="product-item">{{item.total}}</div>
</template>
</template>
</template>
</el-table-column>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column align='left' fixed="right" label="Operate" width="180" header-align="center">
<el-table-column align='center' fixed="right" label="Operate" width="120" header-align="center">
<template slot-scope="scope">
<!-- <el-button type="primary" size="small" @click="editNote('editor',scope.row.id)">edit</el-button> -->
<el-popconfirm confirm-button-text="confirm" cancel-button-text="cancel" style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="Are you sure to delete it?">
<el-popconfirm confirm-button-text="confirm" cancel-button-text="cancel" style="margin:0 10px"
@confirm="deleteList(scope.row.id)" title="Are you sure to delete it?">
<el-button type="danger" size="small" slot="reference">delete</el-button>
</el-popconfirm>
</template>
@ -41,13 +83,12 @@
</template>
<script>
import {
index,
destroy
import {
index,
destroy
} from "@/api/order/index.js"
export default {
components: {
},
components: {},
data() {
return {
select: {
@ -58,35 +99,44 @@
total: 0,
list: [],
table_item: [{
type: 'index',
width: 50,
fixed: 'left'
},{
prop: 'customer',
label: 'Customer',
align: 'left',
},{
prop: 'product',
label: 'Product',
align: 'left',
},{
prop: 'list_price',
label: 'List Price',
align: 'left',
},{
prop: 'quantity',
label: 'Quantity',
align: 'left',
},{
prop: 'email',
label: 'Email',
align: 'left',
},{
prop: 'address',
label: 'Address',
align: 'left',
}
]
type: 'index',
width: 50,
fixed: 'left'
}, {
prop: 'number',
label: 'Order Number',
align: 'left',
width: 240
}, {
prop: 'product',
label: 'Product',
align: 'left',
minWidth: 360,
// multiHd:[{
// prop: 'name',
// label: 'Name',
// align: 'left',
// },{
// prop: 'number',
// label: 'Number',
// align: 'left',
// }]
}, {
prop: 'user.email',
label: 'Email',
align: 'left',
width: 180
}, {
prop: 'user.country',
label: 'Country',
align: 'left',
width: 180
}, {
prop: 'user.address',
label: 'Address',
align: 'left',
width: 360
}]
}
},
created() {
@ -107,23 +157,23 @@
this.select.number = ''
this.getList()
},
async getList() {
const res = await index({
...this.select,
show_relation:['orderProducts','user'],
filter:[{
key:'number',
op:'like',
value:this.select.number
}]
async getList() {
const res = await index({
...this.select,
show_relation: ['orderProducts.product', 'user'],
filter: [{
key: 'number',
op: 'like',
value: this.select.number
}]
})
this.list = res.data
this.total = res.total
},
deleteList(id) {
var that = this;
destroy({
id:id
destroy({
id: id
}).then(response => {
this.$Message.success('Success');
this.getList()
@ -137,5 +187,15 @@
</script>
<style lang="scss" scoped>
::v-deep .product-item {
margin: 0 -10px;
padding: 5px 10px;
border-bottom: 1px solid #EBEEF5;
height: 50px;
display: flex;
align-items: center;
}
::v-deep .el-table td.el-table__cell div .product-item:last-child{
border-bottom:none;
}
</style>

@ -110,7 +110,8 @@
page: this.select.page,
type:this.select.type,
sort_type: 'ASC',
sort_name: 'sort',
sort_name: 'sort',
name:this.select.name
})
this.list = res.data
this.total = res.total

@ -43,7 +43,9 @@
id: '',
type: 'add',
showWang: false,
form: {
form: {
product_category_id:'',
sort:'',
title: '',
content: ''
},
@ -61,6 +63,14 @@
methods: {
changeEditor(e) {
this.form.content = e
},
setProductCategoryId(e){
if(e){
this.form.product_category_id = e
}
},
setSort(e){
this.form.sort = e?e:0
},
submit() {
@ -89,7 +99,8 @@
id: this.id,
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
this.form.content = res.content ? res.content : ''
this.form.content = res.content ? res.content : ''
this.form.sort = res.sort?res.sort:0
this.showWang = true
})
}

@ -29,7 +29,9 @@
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Description
</div>
<div class="xy-table-item-content">
<el-input type="textarea" :rows="5" v-model="form.description"></el-input>
<el-input type="textarea" :rows="5" v-model="form.description"></el-input>
<!-- <my-tinymce v-if="showWang" :height="200" :id="'description'" @input="(e)=>{changeEditor(e,'description')}"
:value="form.description"></my-tinymce> -->
</div>
</div>
</template>
@ -123,7 +125,8 @@
id: '',
uploadOther: {
token: ""
},
},
showWang:false,
action: `${process.env.VUE_APP_UPLOAD_API}`,
pictureList: [],
selectList:[],
@ -171,7 +174,10 @@
return
}
this.pictureList = fileList
},
},
// changeEditor(e,type){
// this.form[type] = e
// },
addRow() {
this.form.product_category_details.push({
key: '',

@ -50,30 +50,75 @@
</div>
</div>
</template>
<template v-slot:picture_id>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Poster
</div>
<div class="xy-table-item-content">
<el-upload :action="action" class='upload-demo' :limit="1" list-type="picture-card"
accept=".PNG,.jpg,.jpeg,.bmp,.svg" :file-list="pictureList" ref="pictureUpload" :auto-upload="true"
:on-success="handlesuccessP" :on-remove="handleRemoveP">
<i class="el-icon-plus"></i>
</el-upload>
</div>
</div>
</template>
<template v-slot:description>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Description
</div>
<div class="xy-table-item-content">
<el-input type="textarea" :rows="5" v-model="form.description"></el-input>
<!-- <el-input type="textarea" :rows="5" v-model="form.description"></el-input> -->
<my-tinymce v-if="showWang" :id="'description'" @input="(e)=>{changeEditor(e,'description')}"
:value="form.description"></my-tinymce>
</div>
</div>
</template>
<template v-slot:picture_id>
<template v-slot:application_note_desc>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Poster
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Application Note Description
</div>
<div class="xy-table-item-content">
<el-upload :action="action" class='upload-demo' :limit="1" list-type="picture-card"
accept=".PNG,.jpg,.jpeg,.bmp,.svg" :file-list="pictureList" ref="pictureUpload" :auto-upload="true"
:on-success="handlesuccessP" :on-remove="handleRemoveP">
<i class="el-icon-plus"></i>
</el-upload>
<!-- <el-input type="textarea" :rows="5" v-model="form.application_note_desc"></el-input> -->
<my-tinymce v-if="showWang" :id="'application_note_desc'"
@input="(e)=>{changeEditor(e,'application_note_desc')}" :value="form.application_note_desc"></my-tinymce>
</div>
</div>
</template>
</template>
<template v-slot:product_category_phase>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Sub Phase
</div>
<div class="xy-table-item-content">
<el-button type="primary" style="margin-bottom:10px" size="small" @click="addSubPhase">Add</el-button>
<xy-table key="1" style="width:850px" :list="form.product_category_phase" :isPage="false" :height="350"
:table-item="sub_detail_item">
<template v-slot:value>
<el-table-column align='left' label="value" width="680">
<template slot-scope="scope">
<el-input placeholder="Please Input" style="width:100%" v-model="scope.row.value"></el-input>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column align='center' label="operate" width="120" header-align="center">
<template slot-scope="scope">
<el-popconfirm confirm-button-text="confirm" cancel-button-text="cancel" style="margin:0 10px"
@confirm="delSubPhase(scope.row.id,scope.$index)" title="Are you sure to delete it?">
<el-button type="danger" size="small" slot="reference">delete</el-button>
</el-popconfirm>
</template>
</el-table-column>
</template>
</xy-table>
</div>
</div>
</template>
<template v-slot:product_category_details>
<div class="xy-table-item">
@ -133,8 +178,8 @@
<div class="xy-table-item-content">
<el-button type="primary" style="margin-bottom:10px" size="small" @click="addAppRow('','add')">Add
Application</el-button>
<xy-table key="2" style="width:850px" :list="applicationsList" :isPage="false" :height="350"
:table-item="application_detail_item">
<xy-table ref="applications" row-key="id" key="2" style="width:850px" :list="applicationsList"
:isPage="false" :height="350" :table-item="application_detail_item">
<template v-slot:btns>
<el-table-column align='center' label="operate" width="180" header-align="center">
<template slot-scope="scope">
@ -174,7 +219,7 @@
<!-- <wangEditor :isShow="isShow" v-show="showWang" :value="form.character"
@change="(e)=>{changeEditor(e,'character')}"></wangEditor> -->
<my-tinymce v-if="showWang" :keyid="'character'" @input="(e)=>{changeEditor(e,'character')}"
<my-tinymce v-if="showWang" :id="'character'" @input="(e)=>{changeEditor(e,'character')}"
:value="form.character"></my-tinymce>
</div>
</div>
@ -185,7 +230,7 @@
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Packing
</div>
<div class="xy-table-item-content">
<my-tinymce :keyid="'packing'" v-if="showWang" @input="(e)=>{changeEditor(e,'packing')}"
<my-tinymce :id="'packing'" v-if="showPacking" @input="(e)=>{changeEditor(e,'packing')}"
:value="form.packing"></my-tinymce>
</div>
</div>
@ -203,17 +248,21 @@
import {
save,
show,
index
index,
phaseDel
} from "@/api/product/category.js"
import {
getToken
} from '@/utils/auth'
import {
destroy,
index as getApp
index as getApp,
batchSort
} from "@/api/product/application.js"
import addApplication from './addApplication.vue';
import productMixin from "@/mixin/product.js"
import Sortable from 'sortablejs';
export default {
mixins: [productMixin],
components: {
@ -222,6 +271,7 @@
data() {
return {
showWang: false,
showPacking: false,
isShow: false,
type: 'add',
id: '',
@ -243,6 +293,15 @@
label: 'Title',
align: 'left',
width: 620
}],
sub_detail_item: [{
type: 'index',
width: 50,
}, {
prop: 'value',
label: 'Name',
align: 'left',
width: 680
}],
detail_item: [{
type: 'index',
@ -263,13 +322,13 @@
name: '',
sort: 0,
is_recommend: 0,
description: '',
picture_id: '',
description: '',
application_note_desc: '',
product_category_phase:[],
product_category_details: [],
product_category_applications: [],
download_ids: [],
character: '',
packing: '',
pid: 0,
@ -284,9 +343,13 @@
},
created() {
this.uploadOther.token = getToken();
},
mounted() {
watch: {
},
mounted() {
this.initSort()
},
methods: {
handleRemoved(file, fileList) {
@ -342,15 +405,37 @@
row.type = this.productDetailsKeyList[e].type
row.list = this.productDetailsKeyList[e].list
row.value = row.type == 'select' ? [] : ''
},
// sub phase
addSubPhase() {
this.form.product_category_phase.push({
value: '',
sort:0
})
},
delSubPhase(id,index) {
if(id){
phaseDel({
id:id
}).then(res=>{
this.form.product_category_phase.splice(index, 1)
})
}else{
this.form.product_category_phase.splice(index, 1)
}
},
// addApplication
addAppRow(id, type) {
if (id) {
this.$refs.addApplication.id = id
}
// id
if (this.id) {
this.$refs.addApplication.setProductCategoryId(this.id)
}
this.$refs.addApplication.setSort(this.applicationsList.length + 1)
this.$refs.addApplication.type = type
this.$refs.addApplication.isShow = true
},
delAppRow(id, index) {
destroy({
@ -366,27 +451,84 @@
reject(error)
})
},
//
initSort() {
const el = this.$refs['applications'].$el.querySelector('.el-table__body-wrapper > table > tbody')
let _this = this;
const ops = {
animation: 200, //
handle: ".el-table__row", //class
//
onMove: ({
dragged,
related
}) => {
const oldRow = _this.applicationsList[dragged.rowIndex] //
const newRow = _this.applicationsList[related.rowIndex] //
},
//
onEnd: evt => {
const curRow = _this.applicationsList.splice(evt.oldIndex, 1)[0]
_this.applicationsList.splice(evt.newIndex, 0, curRow)
this.updateSort()
}
}
Sortable.create(el, ops)
},
// application sort
async updateSort() {
let sortArr = []
this.applicationsList.map((item, index) => {
sortArr.push({
id: item.id,
sort: index + 1
})
})
await batchSort({
data: sortArr
})
},
//idapplicaitonlist
async getApplicationList(id) {
const res = await getApp({
page: 1,
page_size: 9999,
product_category_id: id,
sort_name: 'sort',
sort_type: 'ASC'
})
this.applicationsList = res.data
},
// application phase
// applicationList id
getApplication(res) {
console.log(res)
let _arr = this.base.deepCopy(this.applicationsList)
if (this.applicationsList.length > 0) {
let count = -1
this.applicationsList.map((item, index) => {
if (item.id === res.id) {
count = index
if (this.type === 'add') {
let _arr = this.base.deepCopy(this.applicationsList)
if (this.applicationsList.length > 0) {
let count = -1
this.applicationsList.map((item, index) => {
if (item.id === res.id) {
count = index
}
})
if (count > -1) {
_arr[count] = this.base.deepCopy(res)
} else {
_arr.push(res)
}
})
console.log(count)
if (count > -1) {
_arr[count] = this.base.deepCopy(res)
this.applicationsList = _arr
} else {
_arr.push(res)
this.applicationsList.push(res)
}
this.applicationsList = _arr
this.$forceUpdate()
} else {
this.applicationsList.push(res)
this.getApplicationList(this.id)
}
this.$forceUpdate()
},
checkSubmit() {
this.$refs.dialog.submit()
},
submit() {
if (this.id) {
@ -485,11 +627,16 @@
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
this.form.description = res.description ? res.description : ''
this.form.application_note_desc = res.application_note_desc ? res.application_note_desc : ''
this.form.product_category_phase = res.phase?res.phase:[]
this.form.character = res.character ? res.character : ''
this.form.packing = res.packing ? res.packing : ''
this.applicationsList = res.product_category_applications
// this.applicationsList = res.product_category_applications
this.form.is_recommend = res.is_recommend ? res.is_recommend : 0
this.showWang = true
this.showPacking = true
// applicaitonlist
// category
if (res.product_category_links_by_sub.length > 0) {
@ -534,6 +681,7 @@
this.getCategoryList()
if (this.type === 'editor') {
this.getDetail()
this.getApplicationList(this.id)
}
for (var k in this.productDetailsKeyList) {
if (this.productDetailsKeyList[k]["type"] === 'select') {
@ -549,14 +697,17 @@
}
}
this.showWang = true
this.showPacking = true
} else {
this.id = ''
this.type = "add"
this.showWang = false
this.showPacking = false
this.downloadsList = []
this.pictureList = []
this.applicationsList = []
this.selectList = []
this.selectList = []
this.pcSubList = []
this.form = {
product_category_links_by_sub: [],
@ -564,10 +715,13 @@
sort: 0,
is_recommend: 0,
picture_id: '',
description: '',
application_note_desc: '',
product_category_phase:[],
product_category_details: [],
product_category_applications: [],
download_ids: [],
description: '',
character: '',
packing: '',
pid: 0,
@ -587,6 +741,7 @@
::v-deep .product_category_applications,
::v-deep .download_ids,
::v-deep .description,
::v-deep .application_note_desc,
::v-deep .packing,
::v-deep .character,
{

@ -28,12 +28,25 @@
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>Product Phase
</div>
<div class="xy-table-item-content">
<el-select multiple style="width:100%" filterable v-model="form.category_id" placeholder="Please Select">
<el-select multiple style="width:100%" filterable @change="changeSub" v-model="form.category_id" placeholder="Please Select">
<el-option v-for="(item,index) in categoryList" :key="index" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:phase>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Sub Phase
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" filterable multiple v-model="form.phase" placeholder="Please Select">
<el-option v-for="(item,index) in subPhaseList" :key="index" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:list_price>
<div class="xy-table-item">
@ -48,7 +61,7 @@
<template v-slot:is_visible>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Visible
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Visible前台是否显示
</div>
<div class="xy-table-item-content">
<el-radio-group v-model="form.is_visible">
@ -61,7 +74,7 @@
<template v-slot:is_sell>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Active
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Active当前是否售卖
</div>
<div class="xy-table-item-content">
<el-radio-group v-model="form.is_sell">
@ -74,12 +87,14 @@
<template v-slot:show_price>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Web Visibility
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Web Visibility(是否显示价格)
</div>
<div class="xy-table-item-content">
<el-radio-group v-model="form.show_price" @change="changeWeb">
<el-radio :label="1">Yes</el-radio>
<el-radio :label="0">No</el-radio>
<el-radio-group v-model="form.show_price" @change="changeWeb">
<!-- <el-radio style="margin-bottom:5px" :label="2">Direct display(直接显示价格)</el-radio> -->
<el-radio style="margin-bottom:5px" :label="0">Need to log in(需要登录)</el-radio>
<el-radio style="margin-bottom:5px" :label="1">Need to contact sales(需要联系销售)</el-radio>
</el-radio-group>
</div>
</div>
@ -194,15 +209,17 @@
}, {
prop: 'value',
label: 'value',
}],
}],
subPhaseList:[],
form: {
name: "",
number: '',
category_id: [],
category_id: [],
phase:[],
list_price: '',
is_visible: 1,
is_sell: 1,
show_price: 1,
show_price: 0,
// file_ids: '',
product_details: [],
// content: '',
@ -259,11 +276,26 @@
},
changeWeb(e){
console.log(e)
if(e===0){
if(e===1){
if(this.base.isNull(this.form.list_price)){
this.form.list_price = 99999
}
}
},
changeSub(e){
this.subPhaseList = []
if(e.length>0){
let phase = this.categoryList.filter(item=>{return e.includes(item.id)})
console.log(phase)
phase.map(item=>{
this.subPhaseList.push(...item.phase)
})
console.log("this.subPhaseList",this.subPhaseList)
}else{
this.subPhaseList = []
}
},
submit() {
if (this.id) {
@ -327,7 +359,15 @@
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
// this.form.content = res.content ? res.content : ''
this.form.category_id = res.category_id ? res.category_id : [],
this.form.category_id = res.category_id ? res.category_id : []
this.form.phase = res.phase?res.phase:[]
let phase = this.categoryList.filter(item=>{return res.category_id.includes(item.id)})
phase.map(item=>{
this.subPhaseList.push(...item.phase)
})
this.form.is_visible = res.is_visible?res.is_visible:0
this.form.is_sell = res.is_sell?res.is_sell:0
this.form.show_price = res.show_price?res.show_price:0
@ -373,15 +413,17 @@
} else {
this.id = ''
// this.filesList = []
this.showWang = false
this.showWang = false
this.subPhaseList = []
this.form = {
name: "",
number: '',
category_id: [],
category_id: [],
phase:[],
list_price: '',
is_visible: 1,
is_sell: 1,
show_price: 1,
show_price: 0,
file_ids: '',
product_details: [],
content: '',
@ -404,7 +446,7 @@
::v-deep .is_sell,
::v-deep .is_visible,
::v-deep .show_price {
flex-basis: 33%;
flex-basis: 50%;
}
::v-deep .el-checkbox__input .el-checkbox__inner {

@ -11,6 +11,30 @@
</div>
<div>
<el-input v-model="select.number" placeholder="Part Number"></el-input>
</div>
<div>
<el-select multiple collapse-tags clearable style="width:100%" filterable v-model="select.category_id" placeholder="Product Phase">
<el-option v-for="(item,index) in categoryList" :key="index" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
<div>
<el-select style="width:100%" clearable v-model="select.is_visible" placeholder="Visible">
<el-option v-for="(item,index) in valueList" :key="index" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
<div>
<el-select style="width:100%" clearable v-model="select.is_sell" placeholder="Active">
<el-option v-for="(item,index) in valueList" :key="index" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
<div>
<el-select style="width:100%" clearable v-model="select.show_price" placeholder="Web Visibility">
<el-option v-for="(item,index) in webList" :key="index" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
<div>
<el-button type="primary" size="small" @click="select.page=1,getList()">search</el-button>
@ -73,13 +97,37 @@
return {
select: {
name: '',
number:'',
number:'',
category_id:[],
is_sell:'',
show_price:'',
is_visible:'',
page: 1,
page_size: 10,
},
categoryList: [],
total: 0,
list: [],
list: [],
valueList:[{
id:1,
value:'Yes'
},{
id:0,
value:'No'
}],
webList:[
// {
// id:2,
// value:'Direct display()'
// },
{
id:0,
value:'Need to log in(需要登录)'
},
{
id:1,
value:'Need to contact sales(需要联系销售)'
}],
table_item: [{
type: 'index',
width: 50,
@ -127,9 +175,13 @@
prop: 'show_price',
label: 'Web Visibility(是否显示价格)',
align: 'center',
width: 120,
width: 180,
formatter: (cell, data, value) => {
return value == 1 ? 'Yes' : 'No'
if(value==1){
return 'Need to contact sales(需要联系销售)'
}else{
return 'Need to log in(需要登录)'
}
}
}
]
@ -161,12 +213,17 @@
resetSearch() {
this.select.page = 1
this.select.name = ''
this.select.number = ''
this.select.number = ''
this.select.is_sell = ''
this.select.show_price = ''
this.select.is_visible = ''
this.select.category_id = []
this.getList()
},
async getList() {
const res = await index({
...this.select,
...this.select,
category_id:this.select.category_id,
filter: [{
key: 'name',
op: 'like',
@ -175,7 +232,19 @@
key: 'number',
op: 'like',
value: this.select.number
}]
},{
key: 'is_sell',
op: 'like',
value: this.select.is_sell
},{
key: 'show_price',
op: 'like',
value: this.select.show_price
},{
key: 'is_visible',
op: 'like',
value: this.select.is_visible
}],
})
this.list = res.data
this.total = res.total

@ -135,15 +135,9 @@
type:this.select.type,
sort_type: 'ASC',
sort_name: 'sort',
filter: [{
key: 'name',
op: 'like',
value: this.select.name
},{
key: 'is_recommend',
op: 'eq',
value: this.select.is_recommend
}]
name:this.select.name,
is_recommend:this.select.is_recommend
})
this.list = res.data
this.total = res.total

@ -134,6 +134,9 @@
this.form.id = this.id
} else {
this.form.id = ''
}
if(this.form.type_parameter_details_id_relation){
delete this.form.type_parameter_details_id_relation
}
let _files = []
if (this.filesList.length > 0) {
@ -167,8 +170,7 @@
getDetail() {
show({
table_name: this.table_name,
id: this.id,
json_data_fields: ['files']
id: this.id
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
if (res.files_details && res.files_details.length > 0) {

@ -58,7 +58,8 @@
isShow: false,
showWang: false,
id: '',
type: 'add',
type: 'add',
filesList:[],
uploadOther: {
token: ""
},

@ -1,19 +1,19 @@
<template>
<div>
<xy-dialog ref="dialog" :width="50" :is-show.sync="isShow" :type="'form'" :title="$route.meta.title" :form="form"
:rules='rules' @submit="submit">
<template v-slot:category_ids v-if="table_name==='posters' || table_name==='flyers'">
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Product Phase
</div>
<div class="xy-table-item-content">
<el-select multiple filterable style="width:100%" v-model="form.category_ids" placeholder="Please Select">
<el-option v-for="(item,index) in categoryList" :key="index" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
:rules='rules' @submit="submit">
<template v-slot:category_ids v-if="table_name==='posters' || table_name==='flyers'">
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Product Phase
</div>
<div class="xy-table-item-content">
<el-select multiple filterable style="width:100%" v-model="form.category_ids" placeholder="Please Select">
<el-option v-for="(item,index) in categoryList" :key="index" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:title>
<div class="xy-table-item">
@ -24,6 +24,28 @@
<el-input placeholder="Please Input" style="width:100%" v-model="form.title"></el-input>
</div>
</div>
</template>
<template v-slot:date v-if="table_name==='technical_newsletters'">
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Release Time
</div>
<div class="xy-table-item-content">
<el-date-picker v-model="form.date" style="width:100%" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
type="datetime" placeholder="Please Select">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:link v-if="table_name==='technical_newsletters'">
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Link
</div>
<div class="xy-table-item-content">
<el-input placeholder="Please Input" style="width:100%" v-model="form.link"></el-input>
</div>
</div>
</template>
<template v-slot:files>
<div class="xy-table-item">
@ -37,18 +59,18 @@
</el-upload>
</div>
</div>
</template>
<template v-slot:content v-if="table_name==='technical_newsletters'">
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Content
</div>
<div class="xy-table-item-content">
<!-- <wangEditor :isShow="isShow" v-show="showWang" :value="form.content" @change="changeEditor"></wangEditor> -->
<my-tinymce v-if="showWang" @input="changeEditor" :value="form.content"></my-tinymce>
</div>
</div>
</template>
<template v-slot:content v-if="table_name==='technical_newsletters'">
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Content
</div>
<div class="xy-table-item-content">
<!-- <wangEditor :isShow="isShow" v-show="showWang" :value="form.content" @change="changeEditor"></wangEditor> -->
<my-tinymce v-if="showWang" @input="changeEditor" :value="form.content"></my-tinymce>
</div>
</div>
</template>
</xy-dialog>
@ -79,13 +101,15 @@
},
action: `${process.env.VUE_APP_UPLOAD_API}`,
filesList: [],
categoryList: [],
showWang:false,
categoryList: [],
showWang: false,
form: {
category_ids: '',
title: "",
files: [],
content:''
date: '',
link:'',
files: [],
content: ''
},
rules: {
title: [{
@ -110,19 +134,19 @@
return
}
this.filesList = fileList
},
changeEditor(e) {
this.form.content = e
},
changeEditor(e) {
this.form.content = e
},
async getCategoryList() {
const res = await getCategory({
page_size: 999,
page: 1,
sort_type: 'ASC',
sort_name: 'sort',
type:2
sort_name: 'sort',
type: 2
})
this.categoryList = res.data
this.categoryList = res.data
},
submit() {
@ -167,11 +191,12 @@
id: this.id,
json_data_fields: ['files']
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
if(table_name==='technical_newsletters'){
this.form = this.base.requestToForm(res, this.form)
if (this.table_name === 'technical_newsletters') {
this.form.content = res.content ? res.content : ''
this.showWang = true
}
this.form.date = res.date?res.date:this.$moment().format('YYYY-MM-DD HH:mm:ss')
this.showWang = true
}
if (res.files_details && res.files_details.length > 0) {
this.filesList = []
@ -188,12 +213,16 @@
},
watch: {
isShow(newVal) {
if (newVal) {
if(this.table_name==='technical_newsletters'){
this.showWang = true
}
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}else{
if (this.table_name === 'technical_newsletters') {
this.form.date = this.$moment().format('YYYY-MM-DD HH:mm:ss')
this.showWang = true
}
}
} else {
@ -202,8 +231,9 @@
this.form = {
category_ids: '',
title: "",
files: [],
content:''
date: '',
files: [],
content: ''
}
this.$refs['dialog'].reset()
}
@ -215,9 +245,11 @@
<style scoped lang="scss">
::v-deep .category_ids,
::v-deep .date,
::v-deep .link,
::v-deep .title,
::v-deep .files,
::v-deep .content{
::v-deep .files,
::v-deep .content {
flex-basis: 100%;
}
</style>

@ -97,7 +97,7 @@
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" multiple filterable collapse-tags v-model="form.specific_sample" placeholder="Please Select">
<el-option v-for="item in resourceList.specificSampleList" :key="item.id" :label="item.value"
<el-option v-for="item in appSpecialList" :key="item.id" :label="item.value"
:value="item.id">
</el-option>
</el-select>
@ -135,7 +135,8 @@
type: 'add',
productList: [],
categoryList: [],
applicationList: [],
applicationList: [],
appSpecialList:[],
form: {
category_ids: [],
application_ids:[],
@ -166,7 +167,8 @@
created() {
this.getCategoryList()
this.getProductList()
this.getApplicationList()
this.getApplicationList()
this.getAppSpecial()
},
methods: {
async getCategoryList() {
@ -181,13 +183,32 @@
},
async getApplicationList() {
const res = await getApplication({
page_size: 999,
page_size: 9999,
page: 1,
sort_type: 'ASC',
sort_name: 'sort'
sort_name: 'sort',
filter:[{
key:'type',
op:'eq',
value:0
}]
})
this.applicationList = res.data
},
async getAppSpecial() {
const res = await getApplication({
page_size: 9999,
page: 1,
sort_type: 'ASC',
sort_name: 'sort',
filter:[{
key:'type',
op:'eq',
value:1
}]
})
this.appSpecialList = res.data
},
async getProductList() {
const res = await getProduct({

@ -25,7 +25,19 @@
</div>
</div>
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange"
@pageSizeChange="pageSizeChange" :table-item="table_item">
@pageSizeChange="pageSizeChange" :table-item="table_item">
<template v-slot:created_at>
<el-table-column align='left' label="Relase Time" width="180" header-align="center">
<template slot-scope="scope">
<div v-if="select.table_name==='technical_newsletters'">
{{scope.row.date?scope.row.date:''}}
</div>
<div v-else>
{{scope.row.created_at}}
</div>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column align='left' fixed="right" label="Operate" width="180" header-align="center">
<template slot-scope="scope">
@ -70,12 +82,17 @@
list: [],
table_item: [{
type: 'index',
width: 50,
fixed: 'left'
width: 50,
fixed:'left'
}, {
prop: 'title',
label: 'Title',
align: 'left',
},{
prop: 'created_at',
label: 'Relase Time',
align: 'left',
width:180
}
]
@ -114,6 +131,8 @@
async getList() {
const res = await index({
...this.select,
sort_name:this.select.table_name==='technical_newsletters'?"date":'',
sort_type:this.select.table_name==='technical_newsletters'?"DESC":'',
filter:[{
key:'title',
op:'like',

@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: process.env.ENV === 'staging' ? '/admin_test' : '/admin',
outputDir: '/Users/mac/Documents/朗业/2024/s-美国赛分/saifen/public/admin',
outputDir: '/Users/mac/Documents/朗业/2024/s-美国赛分/saifen/public/admin_test',
assetsDir: 'static',
css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项

Loading…
Cancel
Save