2023-11-9-dist
This commit is contained in:
@@ -98,11 +98,11 @@ export default defineComponent({
|
||||
handler(newVal:any,oldVal:any){
|
||||
this.sketchList = []
|
||||
// this.sketch = [[],[],[]]
|
||||
console.log(111);
|
||||
this.sketchList = this.allBoardData.sketchboardFiles
|
||||
this.setSketch()
|
||||
}
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
setSketch(){
|
||||
|
||||
@@ -154,6 +154,7 @@ import Habit from "@/component/Detail/habit.vue";
|
||||
import { Https } from "@/tool/https";
|
||||
import { Modal, message } from "ant-design-vue";
|
||||
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
|
||||
import { useStore } from "vuex";
|
||||
import { useI18n } from "vue-i18n";
|
||||
export default defineComponent({
|
||||
components: {
|
||||
@@ -161,9 +162,11 @@ export default defineComponent({
|
||||
Habit,
|
||||
},
|
||||
setup(){
|
||||
const store = useStore();
|
||||
const {t} = useI18n()
|
||||
const {locale} = useI18n()
|
||||
return {
|
||||
store,
|
||||
t,
|
||||
locale
|
||||
}
|
||||
|
||||
@@ -75,28 +75,36 @@ import { useStore } from "vuex";
|
||||
export default defineComponent({
|
||||
components:{MoodTemplate},
|
||||
setup() {
|
||||
const store = useStore();
|
||||
const store:any = useStore();
|
||||
let sketch:any = ref([[],[],[]])
|
||||
let sketchList = ref([])
|
||||
let sketchList:any = ref([])
|
||||
let allBoardData:any = computed(()=>{
|
||||
return store.state.UploadFilesModule.allBoardData})
|
||||
return {
|
||||
store,
|
||||
allBoardData,
|
||||
sketch,
|
||||
sketchList,
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
asda:{},
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
allBoardData:{
|
||||
handler(newVal:any,oldVal:any){
|
||||
this.sketchList = []
|
||||
// this.sketch = [[],[],[]]
|
||||
console.log(111);
|
||||
this.sketchList = this.allBoardData.sketchboardFiles
|
||||
this.setSketch()
|
||||
}
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
mounted () {
|
||||
|
||||
},
|
||||
@@ -110,7 +118,6 @@ export default defineComponent({
|
||||
sketch1.num = 0
|
||||
sketch2.num = 1
|
||||
sketch3.num = 2
|
||||
console.log(this.sketchList);
|
||||
for (let i = 0; i < this.sketchList.length; i++) {
|
||||
let arr = [sketch1,sketch2,sketch3]
|
||||
arr.sort((a,b)=>{
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
@onCancel="clearSetLabel"
|
||||
>
|
||||
<div class="setLabel_centent">
|
||||
<div @click="removeLabel(options)">删除</div>
|
||||
<ul class="optionsItem">
|
||||
<li class="optionsItem_title" v-for="optionsItem,optionsIndex in options" :key="optionsItem.id">
|
||||
<div class="setLabel_text">
|
||||
@@ -20,14 +21,14 @@
|
||||
</div>
|
||||
|
||||
<ul class="childrenItem active" v-mousewheel>
|
||||
<li class="childrenItem_title setLabel_text" v-for="childrenItem,childrenIndex in optionsItem.children" :key="childrenItem.id">
|
||||
<a-checkbox v-model:checked="childrenItem.checkAll"></a-checkbox>
|
||||
<li class="childrenItem_title setLabel_text" v-for="childrenItem,childrenIndex in optionsItem.childList" :key="childrenItem.id">
|
||||
<a-checkbox v-model:checked="childrenItem.checkAll" @change="onCheckAllchildrenItem(optionsItem)"></a-checkbox>
|
||||
<span v-show="!childrenItem.openType">{{ childrenItem.classificationName }}</span>
|
||||
<input v-show="childrenItem.openType" type="text" v-model="itemName">
|
||||
<i v-show="childrenItem.openType" @click.stop="putName(index,'affirm',childrenItem)" class="fi fi-br-check"></i>
|
||||
<i v-show="!childrenItem.openType" @click.stop="putName(childrenIndex,'put',childrenItem)" class="fi fi-rr-edit"></i>
|
||||
</li>
|
||||
<li @click="newLabel(optionsItem)" class="newLabel setLabel_text">
|
||||
<li @click="newLabel(optionsItem,optionsItem.id)" class="newLabel setLabel_text">
|
||||
<input v-show="optionsItem.addOpenType" type="text" v-model="itemName">
|
||||
<i @click.stop="putName(-1,'affirm',optionsItem)" v-show="optionsItem.addOpenType" class="fi fi-br-check"></i>
|
||||
<div v-show="!optionsItem.addOpenType">+</div>
|
||||
@@ -62,7 +63,7 @@ export default defineComponent({
|
||||
setup() {
|
||||
let multiple = ref(false)
|
||||
let indeterminate = ref(true)
|
||||
let options:any = inject('options')//父组件传过来的数据
|
||||
let options:any = ref([])//父组件传过来的数据
|
||||
let type:any = inject('type')//父组件传过来的数据
|
||||
let checkedList = ref([])
|
||||
let openType = ref(false)
|
||||
@@ -127,103 +128,156 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
init(str:any){
|
||||
init(str:any,data:any){
|
||||
this.setLabelShow = true
|
||||
if(str === 'add'){
|
||||
this.multiple = false
|
||||
}else{
|
||||
this.multiple = true
|
||||
}
|
||||
|
||||
this.clearOpenType()
|
||||
this.options = data
|
||||
},
|
||||
clearSetLabel(){
|
||||
this.setLabelShow = false
|
||||
this.clearOpenType()
|
||||
},
|
||||
onCheckAllChange(value:any){
|
||||
value.children.forEach((item:any) => {
|
||||
item.checkAll = value.checkAll
|
||||
if(value?.childList){
|
||||
value?.childList.forEach((item:any) => {
|
||||
item.checkAll = value.checkAll
|
||||
});
|
||||
}
|
||||
},
|
||||
onCheckAllchildrenItem(value:any){
|
||||
let boor = value?.childList.every( (item:any) => item.checkAll )
|
||||
if(boor){
|
||||
value.checkAll = true
|
||||
}else{
|
||||
value.checkAll = false
|
||||
}
|
||||
},
|
||||
clearOpenType(){
|
||||
this.options.forEach((optionsItem:any) => {
|
||||
optionsItem.openType = false
|
||||
optionsItem.addOpenType = false
|
||||
if(optionsItem?.children){
|
||||
optionsItem?.children?.forEach((childrenItem:any) => {
|
||||
childrenItem.openType = false
|
||||
});
|
||||
}
|
||||
});
|
||||
this.openType = false
|
||||
},
|
||||
putName(index:number,v:string,item:any){
|
||||
let data:any
|
||||
if(v == 'put'){
|
||||
this.options.forEach((optionsItem:any) => {
|
||||
optionsItem.openType = false
|
||||
optionsItem.addOpenType = false
|
||||
optionsItem.children.forEach((childrenItem:any) => {
|
||||
childrenItem.openType = false
|
||||
});
|
||||
});
|
||||
this.clearOpenType()
|
||||
item.openType = true
|
||||
this.itemName = item.label
|
||||
|
||||
|
||||
this.itemName = item.classificationName
|
||||
// this.options[index].openType = true
|
||||
// this.itemName = this.workspace.workspaceList[index].workSpaceName
|
||||
}else if(v == 'affirm'){
|
||||
|
||||
if(index == -1){
|
||||
if(this.itemName == ''){
|
||||
message.warning(this.t('Habit.jsContent2'));
|
||||
}else{
|
||||
console.log(this.itemName);
|
||||
let data:any = {
|
||||
label:this.itemName,
|
||||
value:this.itemName,
|
||||
}
|
||||
|
||||
if(item){
|
||||
item.addOpenType = false
|
||||
item.children.push(data)
|
||||
data = {
|
||||
classificationName:this.itemName,
|
||||
parentId:item.id
|
||||
}
|
||||
}else{
|
||||
this.openType = false
|
||||
data.children = []
|
||||
this.options.push(data)
|
||||
data = {
|
||||
classificationName:this.itemName,
|
||||
parentId:''
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
item.label = this.itemName
|
||||
data = {
|
||||
id:item.id,
|
||||
classificationName:this.itemName,
|
||||
}
|
||||
item.classificationName = this.itemName
|
||||
item.openType = false
|
||||
}
|
||||
this.addLabel(data)
|
||||
}
|
||||
},
|
||||
newLabel(item:any){
|
||||
// console.log(index);
|
||||
this.itemName = ''
|
||||
this.options.forEach((optionsItem:any) => {
|
||||
optionsItem.openType = false
|
||||
optionsItem.addOpenType = false
|
||||
optionsItem.children.forEach((childrenItem:any) => {
|
||||
childrenItem.openType = false
|
||||
});
|
||||
});
|
||||
this.openType = false
|
||||
newLabel(item:any,id:any){
|
||||
this.itemName = ''
|
||||
this.clearOpenType()
|
||||
|
||||
if(item){
|
||||
item.addOpenType = true
|
||||
}else{
|
||||
this.openType = true
|
||||
}
|
||||
// console.log(item.addOpenType);
|
||||
|
||||
// this.options.forEach((optionsItem:any) => {
|
||||
// optionsItem.openType = false
|
||||
// optionsItem.children.forEach((childrenItem:any) => {
|
||||
// childrenItem.openType = false
|
||||
// });
|
||||
// });
|
||||
// this.itemName = ''
|
||||
// item.openType = true
|
||||
this.addLabel()
|
||||
if(item){
|
||||
item.addOpenType = true
|
||||
}else{
|
||||
this.openType = true
|
||||
}
|
||||
},
|
||||
addLabel(){
|
||||
removeLabel(val:any){
|
||||
let data:any = []
|
||||
this.clearOpenType()
|
||||
val.forEach((optionsItem:any) => {
|
||||
if(optionsItem.checkAll){
|
||||
data.push(optionsItem)
|
||||
}else{
|
||||
if(optionsItem.childList){
|
||||
let boor = false
|
||||
let dataChild:any = []
|
||||
optionsItem.childList.forEach((childrenItem:any) => {
|
||||
if(childrenItem.checkAll){
|
||||
boor = true
|
||||
dataChild.push(childrenItem)
|
||||
}
|
||||
});
|
||||
if(boor){
|
||||
optionsItem.childList = dataChild
|
||||
data.push(optionsItem)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
this.deleteClass(data)
|
||||
},
|
||||
addLabel(val:any){
|
||||
let data = this.setLabelData()
|
||||
console.log(data);
|
||||
|
||||
if(val.parentId){//新增
|
||||
data.parentId = val.parentId
|
||||
}
|
||||
if(val.id){//修改
|
||||
data.id = val.id
|
||||
}
|
||||
data.classificationName = val.classificationName
|
||||
|
||||
Https.axiosPost(Https.httpUrls.saveOrUpdate, data).then(
|
||||
(rv: any) => {
|
||||
console.log(rv);
|
||||
|
||||
this.getClass()
|
||||
}
|
||||
).catch((res)=>{
|
||||
});
|
||||
},
|
||||
deleteClass(data:any){
|
||||
Https.axiosPost(Https.httpUrls.classificationDelete, data).then(
|
||||
(rv: any) => {
|
||||
console.log(rv);
|
||||
}
|
||||
).catch((res)=>{
|
||||
});
|
||||
},
|
||||
getClass(){
|
||||
let data = this.setLabelData()
|
||||
Https.axiosPost(Https.httpUrls.queryClassification, data).then(
|
||||
(rv: any) => {
|
||||
console.log(rv);
|
||||
|
||||
this.options = rv
|
||||
}
|
||||
).catch((res)=>{
|
||||
});
|
||||
},
|
||||
setLabelData(){
|
||||
|
||||
Reference in New Issue
Block a user