Merge branch 'dev' into vite

# Conflicts:
#	examples/main.js
#	examples/router/autoRoutes.js
#	package.json
#	packages/bigscreen/designer/AppDesigner.vue
#	packages/bigscreen/designer/components/Add.vue
#	packages/bigscreen/designer/components/Layout.vue
#	packages/bigscreen/designer/components/List.vue
#	packages/bigscreen/designer/components/SourceData.vue
#	packages/bigscreen/designer/components/form/DataConfig.vue
#	packages/bigscreen/designer/config.js
#	packages/bigscreen/viewer/AppGigscreenViewer.vue
#	packages/conv/creditScore/scoreManage/scoreChange.vue
#	packages/index.js
#	project/dv/apps/AppGridDV.vue
#	project/dvui/components/AiMonitor/dhVideo.vue
#	project/dvui/components/AiSwiper.vue
#	project/dvui/layout/AiDvBackground.vue
#	project/dvui/layout/AiDvSummary/AiDvSummary.vue
#	project/dvui/layout/AiDvWrapper/AiDvWrapper.vue
#	project/dvui/package.json
#	public/index.html
#	vue.config.js
This commit is contained in:
aixianling
2022-07-07 09:01:40 +08:00
208 changed files with 14871 additions and 8799 deletions

View File

@@ -1,73 +1,72 @@
<template>
<div class="doc-circulation ailist-wrapper">
<keep-alive :include="['List']">
<component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component>
<component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"/>
</keep-alive>
</div>
</template>
<script>
import List from './components/List'
import Add from './components/Add'
import Detail from './components/Detail'
import List from './components/List'
import Add from './components/Add'
import Detail from './components/Detail'
export default {
name: 'AppContentManage',
label: '内容管理',
export default {
name: 'AppContentManage',
label: '内容管理',
props: {
instance: Function,
dict: Object
},
props: {
instance: Function,
dict: Object
},
data () {
return {
component: 'List',
params: {},
include: []
data() {
return {
component: 'List',
params: {},
include: []
}
},
components: {
Add,
List,
Detail
},
created() {
this.dict.load("yesOrNo")
},
methods: {
onChange(data) {
if (data.type === 'Add') {
this.component = 'Add'
this.params = data.params
}
},
components: {
Add,
List,
Detail
},
if (data.type === 'Detail') {
this.component = 'Detail'
this.params = data.params
}
mounted () {
},
if (data.type === 'list') {
this.component = 'List'
this.params = data.params
methods: {
onChange (data) {
if (data.type === 'Add') {
this.component = 'Add'
this.params = data.params
}
if (data.type === 'Detail') {
this.component = 'Detail'
this.params = data.params
}
if (data.type === 'list') {
this.component = 'List'
this.params = data.params
this.$nextTick(() => {
if (data.isRefresh) {
this.$refs.component.getList()
}
})
}
this.$nextTick(() => {
if (data.isRefresh) {
this.$refs.component.getList()
}
})
}
}
}
}
</script>
<style lang="scss">
.doc-circulation {
height: 100%;
background: #F3F6F9;
overflow: auto;
}
.doc-circulation {
height: 100%;
background: #F3F6F9;
overflow: auto;
}
</style>

View File

@@ -9,7 +9,8 @@
<template #content>
<el-form class="ai-form" :model="form" label-width="120px" ref="form">
<el-form-item label="模块名称" style="width: 100%;" prop="moduleName" :rules="[{required: true, message: '请输入模块名称', trigger: 'blur'}]">
<el-input type="input" style="width: 300px" size="small" v-model="form.moduleName" clearable placeholder="请输入模块名称" maxlength="30" show-word-limit></el-input>
<el-input type="input" style="width: 300px" size="small" v-model="form.moduleName" clearable placeholder="请输入模块名称" maxlength="30"
show-word-limit></el-input>
</el-form-item>
<el-form-item prop="menuName" label="菜单名称" :rules="[{required: true, message: '请选择菜单', trigger: 'change'}]">
<el-input type="input" style="width: 300px" disabled size="small" v-model="form.menuName" clearable placeholder="请选择菜单">
@@ -24,25 +25,30 @@
<el-radio label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否可评论" style="width: 100%;" prop="isComment" :rules="[{required: true, message: '请选择是否可评论'}]">
<el-radio-group v-model="form.isComment">
<el-radio v-for="op in dict.getDict('yesOrNo')" :key="op.dictValue" :label="op.dictValue">{{ op.dictName }}</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</template>
</ai-card>
<ai-dialog
:visible.sync="isShowAdd"
width="880px"
height="580px"
title="选择菜单"
@close="onClose"
@onConfirm="onConfirm">
:visible.sync="isShowAdd"
width="880px"
height="580px"
title="选择菜单"
@close="onClose"
@onConfirm="onConfirm">
<el-tree
:data="treeData"
node-key="id"
ref="tree"
@node-click="onChange"
highlight-current
:default-expanded-keys="defaultExpandedKeys"
:default-checked-keys="defaulCheckedKeys"
:props="defaultProps">
:data="treeData"
node-key="id"
ref="tree"
@node-click="onChange"
highlight-current
:default-expanded-keys="defaultExpandedKeys"
:default-checked-keys="defaulCheckedKeys"
:props="defaultProps">
</el-tree>
</ai-dialog>
</template>
@@ -54,130 +60,130 @@
</template>
<script>
import { mapState } from 'vuex'
import {mapState} from 'vuex'
export default {
name: 'Add',
export default {
name: 'Add',
props: {
instance: Function,
dict: Object,
params: Object
},
props: {
instance: Function,
dict: Object,
params: Object
},
data () {
return {
info: {},
form: {
moduleName: '',
menuId: '',
menuName: '',
needExamine: '0'
},
isShowAdd: false,
treeData: [],
id: '',
chooseNode: {},
defaultExpandedKeys: [],
defaulCheckedKeys: [],
defaultProps: {
children: 'subSet',
label: 'name',
disabled: e => {
return e.type !== '1'
}
data() {
return {
info: {},
form: {
moduleName: '',
menuId: '',
menuName: '',
needExamine: '0'
},
isShowAdd: false,
treeData: [],
id: '',
chooseNode: {},
defaultExpandedKeys: [],
defaulCheckedKeys: [],
defaultProps: {
children: 'subSet',
label: 'name',
disabled: e => {
return e.type !== '1'
}
}
},
computed: {
...mapState(['user'])
},
created () {
this.getMenuList()
if (this.params && this.params.id) {
this.id = this.params.id
this.getInfo(this.params.id)
}
},
methods: {
getInfo (id) {
this.instance.post(`/app/appcontentmoduleinfo/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.form = res.data
}
})
},
showAdd () {
this.isShowAdd = true
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.form.menuId)
this.defaultExpandedKeys = [this.form.menuId]
this.chooseNode = {
menuId: this.form.menuId,
menuName: this.form.menuName,
type: '1'
}
})
},
onClose () {
},
onConfirm () {
if (this.chooseNode.type === '1') {
this.form.menuId = this.chooseNode.id
this.form.menuName = this.chooseNode.name
this.isShowAdd = false
} else {
this.$message.error('无法选择')
}
},
onChange (e) {
this.chooseNode = e
},
getMenuList () {
this.instance.post(`/admin/menu/menuTree?containPermission=0`).then(res => {
if (res.code === 0) {
this.treeData = res.data
}
})
},
confirm () {
this.$refs.form.validate((valid) => {
if (valid) {
this.instance.post(`/app/appcontentmoduleinfo/addOrUpdate`, {
...this.form,
id: this.params.id || ''
}).then(res => {
if (res.code == 0) {
this.$message.success('提交成功')
setTimeout(() => {
this.cancel(true)
}, 600)
}
})
}
})
},
cancel (isRefresh) {
this.$emit('change', {
type: 'list',
isRefresh: !!isRefresh
})
}
}
},
computed: {
...mapState(['user'])
},
created() {
this.getMenuList()
if (this.params && this.params.id) {
this.id = this.params.id
this.getInfo(this.params.id)
}
},
methods: {
getInfo(id) {
this.instance.post(`/app/appcontentmoduleinfo/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.form = res.data
}
})
},
showAdd() {
this.isShowAdd = true
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.form.menuId)
this.defaultExpandedKeys = [this.form.menuId]
this.chooseNode = {
menuId: this.form.menuId,
menuName: this.form.menuName,
type: '1'
}
})
},
onClose() {
},
onConfirm() {
if (this.chooseNode.type === '1') {
this.form.menuId = this.chooseNode.id
this.form.menuName = this.chooseNode.name
this.isShowAdd = false
} else {
this.$message.error('无法选择')
}
},
onChange(e) {
this.chooseNode = e
},
getMenuList() {
this.instance.post(`/admin/menu/menuTree?containPermission=0`).then(res => {
if (res.code === 0) {
this.treeData = res.data
}
})
},
confirm() {
this.$refs.form.validate((valid) => {
if (valid) {
this.instance.post(`/app/appcontentmoduleinfo/addOrUpdate`, {
...this.form,
id: this.params.id || ''
}).then(res => {
if (res.code == 0) {
this.$message.success('提交成功')
setTimeout(() => {
this.cancel(true)
}, 600)
}
})
}
})
},
cancel(isRefresh) {
this.$emit('change', {
type: 'list',
isRefresh: !!isRefresh
})
}
}
}
</script>
<style scoped lang="scss">

View File

@@ -0,0 +1,73 @@
<template>
<section class="AiEditInput" :class="{[align]:true,error}">
<el-input v-if="edit" size="small" v-model="content" @change="handleChange" @blur="cancel" clearable autofocus/>
<div class="valueText" v-else v-text="value" @click="edit=true"/>
</section>
</template>
<script>
export default {
name: "AiEditInput",
model: {
prop: "value",
event: "change"
},
props: {
value: {default: ""},
align: {default: ""},
error: Boolean
},
data() {
return {
edit: false,
content: ""
}
},
methods: {
cancel() {
this.edit = false
},
handleChange(v) {
this.$emit('change', v)
this.$emit('update:error', false)
}
},
watch: {
edit(v) {
v && (this.content = this.$copy(this.value))
}
}
}
</script>
<style lang="scss" scoped>
::v-deep.AiEditInput {
&.error {
background: rgba(#f46, .2);
}
input {
text-align: center;
}
.valueText {
width: 100%;
height: 100%;
min-height: 32px;
display: flex;
align-items: center;
justify-content: center;
}
&.left {
input {
text-align: left
}
.valueText {
justify-content: flex-start;
}
}
}
</style>

View File

@@ -6,61 +6,40 @@
<template slot="content">
<ai-search-bar class="search-bar">
<template #left>
<el-button size="small" type="primary" icon="iconfont iconAdd" @click="toAdd('')">添加模块</el-button>
<el-button size="small" type="primary" icon="iconfont iconAdd" @click="toAdd()">添加模块</el-button>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
style="margin-top: 6px;"
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
:tableData="tableData"
:col-configs="colConfigs"
:total="total" :dict="dict"
style="margin-top: 6px;"
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
<el-table-column slot="options" width="160px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="toAdd(row.id)">编辑</el-button>
<el-button type="text" @click="moduleId = row.id, form.moduleId = row.id, getCateList(), isShowAdd = true">分类</el-button>
<el-button type="text" @click="getCateList(row.id),isShowAdd = true">分类</el-button>
<el-button type="text" @click="remove(row.id)">删除</el-button>
</div>
</template>
</el-table-column>
</ai-table>
<ai-dialog
:visible.sync="isShowAdd"
width="880px"
height="580px"
title="文章分类"
@close="onClose"
@onConfirm="onConfirm(false)">
<el-form ref="form" class="ai-form" :model="form" label-width="110px" label-position="right">
<el-form-item label="分类名称" style="width: 500px;" prop="categoryName" :rules="[{ required: true, message: '请输入分类名称', trigger: 'blur' }]">
<div class="catewrapper">
<el-input size="small" style="width: 300px;" placeholder="请输入分类名称" v-model="form.categoryName">
</el-input>
<el-button style="margin-left: 20px;" size="small" type="primary" icon="iconfont iconAdd" v-if="!id" @click="onConfirm(true)">添加</el-button>
</div>
</el-form-item>
</el-form>
<ai-table
v-if="!id"
class="detail-table__table"
:border="true"
tableSize="small"
:total="cateTotal"
:tableData="cateList"
:col-configs="cateColConfigs"
:current.sync="cateSearch.current"
:size.sync="cateSearch.size"
:stripe="false"
@getList="getCateList">
<ai-dialog :visible.sync="isShowAdd" width="880px" height="580px" title="文章分类" @close="onClose" @onConfirm="submitCategory">
<el-button icon="iconfont iconAdd" type="text" @click="cateList.push({error:false,categoryName:null})">添加分类</el-button>
<ai-table v-if="moduleId" :tableData="cateList" :col-configs="cateColConfigs" :isShowPagination="false" @getList="getCateList">
<el-table-column slot="category" label="分类名称" align="center">
<template slot-scope="{row}">
<ai-edit-input v-model="row.categoryName" :error.sync="row.error"/>
</template>
</el-table-column>
<el-table-column slot="options" width="220px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="id = row.id, form.categoryName = row.categoryName">编辑</el-button>
<el-button type="text" @click="removeCate(row.id)">删除</el-button>
</div>
<template slot-scope="{ row,$index }">
<el-button type="text" @click="handleMove(row,$index,-1)" :disabled="$index==0">上移</el-button>
<el-button type="text" @click="handleMove(row,$index,1)" :disabled="$index==(cateList.length-1)">下移</el-button>
<el-button type="text" @click="removeCate($index)">删除</el-button>
</template>
</el-table-column>
</ai-table>
@@ -70,158 +49,129 @@
</template>
<script>
export default {
name: 'List',
import AiEditInput from "./AiEditInput";
props: {
instance: Function,
dict: Object
},
export default {
name: 'List',
components: {AiEditInput},
props: {
instance: Function,
dict: Object
},
data() {
return {
search: {
current: 1,
size: 10,
title: ''
},
moduleId: '',
cateSearch: {
current: 1,
size: 10
},
total: 10,
cateList: [],
colConfigs: [
{ prop: 'moduleName', label: '模块名称', align: 'left', width: '200px' },
{ prop: 'menuName', label: '关联菜单', align: 'center' },
{ prop: 'categoryStr', label: '文章分类', align: 'center' },
{ prop: 'needExamine', label: '是否审核', align: 'center', formart: v => v === '0' ? '否' : '是' }
],
cateColConfigs: [
{prop: 'categoryName', label: '分类名称', align: 'center'}
],
form: {
categoryName: '',
moduleId: '',
showIndex: 1
},
cateTotal: 0,
isShowAdd: false,
id: '',
tableData: []
}
},
mounted() {
this.getList()
},
methods: {
getList() {
this.instance.post(`/app/appcontentmoduleinfo/list`, null, {
params: {
...this.search
}
}).then(res => {
if (res.code == 0) {
this.tableData = res.data.records
this.total = res.data.total
}
})
data() {
return {
search: {
current: 1,
size: 10,
title: ''
},
moduleId: '',
total: 10,
cateList: [],
colConfigs: [
{prop: 'moduleName', label: '模块名称', align: 'left', width: '200px'},
{prop: 'menuName', label: '关联菜单', align: 'center'},
{prop: 'categoryStr', label: '文章分类', align: 'center'},
{prop: 'needExamine', label: '是否审核', align: 'center', dict: 'yesOrNo'},
{prop: 'isComment', label: '是否可以评论', align: 'center', dict: 'yesOrNo'}
],
cateColConfigs: [
{type: 'index', label: "排序", align: 'center'},
{slot: 'category'}
],
isShowAdd: false,
tableData: []
}
},
getCateList () {
this.instance.post(`/app/appcontentmodulecategory/list`, null, {
params: {
...this.cateSearch,
moduleId: this.moduleId
}
}).then(res => {
if (res.code == 0) {
this.cateList = res.data.records
this.cateTotal = res.data.total
}
})
},
mounted() {
this.getList()
},
removeCate(id) {
this.$confirm('确定删除该数据?').then(() => {
this.instance.post(`/app/appcontentmodulecategory/delete?ids=${id}`).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()
this.getCateList()
}
})
})
},
remove(id) {
this.$confirm('确定删除该数据?').then(() => {
this.instance.post(`/app/appcontentmoduleinfo/delete?ids=${id}`).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()
}
})
})
},
onConfirm (flag) {
if (!flag && !this.id) {
this.isShowAdd = false
return false
methods: {
getList() {
this.instance.post(`/app/appcontentmoduleinfo/list`, null, {
params: {
...this.search
}
this.$refs.form.validate((valid) => {
if (valid) {
this.instance.post(`/app/appcontentmodulecategory/addOrUpdate`, {
...this.form,
id: this.id || ''
}).then(res => {
if (res.code == 0) {
this.$message.success('提交成功')
this.getList()
this.getCateList()
this.form.categoryName = ''
if (this.id) {
this.id = ''
return false
}
}
})
}).then(res => {
if (res.code == 0) {
this.tableData = res.data.records
this.total = res.data.total
}
})
},
getCateList(moduleId) {
this.moduleId = moduleId
this.instance.post(`/app/appcontentmodulecategory/list`, null, {
params: {size: 99999, moduleId}
}).then(res => {
if (res?.data) {
this.cateList = res.data.records.map(e => ({...e, error: false}))
}
})
},
removeCate(i) {
this.$confirm('确定删除该数据?').then(() => {
this.cateList.splice(i, 1)
})
},
handleMove(row, i, forward) {
const tmp = this.$copy(row), target = i + forward
this.cateList.splice(i, 1, this.cateList[target])
this.cateList.splice(target, 1, tmp)
},
remove(id) {
this.$confirm('确定删除该数据?').then(() => {
this.instance.post(`/app/appcontentmoduleinfo/delete?ids=${id}`).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()
}
})
},
onClose () {
this.id = ''
this.moduleId = ''
this.form.categoryName = ''
this.form.moduleId = ''
},
toAdd(id) {
this.$emit('change', {
type: 'Add',
params: {
id: id || ''
})
},
submitCategory() {
if (!this.cateList.some((e, i, arr) => {
arr[i].error = !e.categoryName
if (!e.categoryName) {
this.$message.error(`${i + 1}行未填写分类名称!`)
return true
}
})) {
const {cateList: categorys, moduleId} = this
this.instance.post(`/app/appcontentmodulecategory/addOrUpdate2`, {
categorys, moduleId
}).then(res => {
if (res?.code == 0) {
this.$message.success('提交成功')
this.isShowAdd = false
this.getList()
}
})
}
},
onClose() {
this.moduleId = ''
this.cateList = []
},
toAdd(id) {
this.$emit('change', {
type: 'Add',
params: {id}
})
}
}
}
</script>
<style lang="scss" scoped>
.notice {
.catewrapper {
display: flex;
align-items: center;
}
.notice {
.catewrapper {
display: flex;
align-items: center;
}
}
</style>

View File

@@ -118,6 +118,7 @@ export default {
linkName: [{ required: true, message: '请输入联系人', trigger: 'change' }],
linkPhone: [{ required: true, message: '请输入联系方式', trigger: 'change' }],
},
flag: true
}
},
// 计算
@@ -148,8 +149,10 @@ export default {
// 确定新增
confirm() {
if(!this.flag) return
this.$refs['ruleForm'].validate((valid) => {
if (valid) {
this.flag = false
this.instance
.post(`/app/appjob/addOrUpdate`, {
title: this.formData.title,

View File

@@ -95,9 +95,11 @@
})
},
remove(id) {
remove(ids) {
this.$confirm('确定删除该数据?').then(() => {
this.instance.post(`/app/appjob/delete?id=${id}`).then(res => {
this.instance.post(`/app/appjob/delete`,null,{
params:{ids}
}).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()