Commit f91378d5 authored by 罗超's avatar 罗超

1

parent cffd8b77
......@@ -17,7 +17,8 @@
"ant-design-vue": "^2.2.8",
"axios": "^0.21.1",
"core-js": "^3.6.5",
"element-plus": "^1.2.0-beta.2",
"dayjs": "^1.10.7",
"element-plus": "^1.2.0-beta.3",
"katex": "^0.13.18",
"lockr": "^0.9.0-beta.0",
"lodash": "^4.17.21",
......
......@@ -29,7 +29,7 @@ module.exports = configure(function (ctx) {
// app boot file (/src/boot)
// --> boot files are part of "main.js"
// https://v2.quasar.dev/quasar-cli/boot-files
boot: ['i18n', 'axios', 'dict', 'permission', 'globalcmp'],
boot: ['i18n', 'axios', 'dict', 'permission', 'globalcmp', 'antDesign'],
// https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-css
css: ['app.scss'],
......
......@@ -121,10 +121,12 @@ service.interceptors.response.use(
position:"top"
})
if (response.data.Code === 10000 || response.data.Code === 10001) {
console.log(124, response.data)
localStorage.clear()
router.replace({
path: '/auth/login'
})
location.reload()
}
}
} else {
......
import { boot } from 'quasar/wrappers'
import axios, { AxiosInstance } from 'axios'
import { Cascader, DatePicker } from 'ant-design-vue'
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$axios: AxiosInstance
......@@ -20,7 +20,6 @@ export default boot(({ app }) => {
app.config.globalProperties.$axios = axios
// ^ ^ ^ this will allow you to use this.$axios (for Vue Options API form)
// so you won't necessarily have to import axios in each vue file
app.use(Cascader, DatePicker)
/**
* @deprecated 弃用的方法
*/
......
......@@ -110,13 +110,13 @@
if (x.ChildList.length > 0) {
x.ChildList.forEach(j => {
j.chek = false;
// for (let index = 0; index < this.list.length; index++) {
// const element = this.list[index];
// if (element.Id == j.Id) {
// j.chek = true;
// break
// }
// }
for (let index = 0; index < props.list.length; index++) {
const element = props.list[index];
if (element.Id == j.Id) {
j.chek = true;
break
}
}
})
}
})
......
......@@ -96,8 +96,33 @@
emit-value
map-options
/>
<div class="cascader" v-if="x.Type == 3">
<a-cascader
v-model:value="birthday"
:options="dateOptions"
placeholder="请选择"
expandTrigger="hover"
size="large"
@change="changeDate($event, y)"
/>
</div>
<div v-if="x.Type == 4">
<a-range-picker
style="width:auto"
v-model:value="x.rangeArr"
size="large"
:locale="locale"
format="YYYY/MM/DD HH:mm:ss"
showTime
@change="changeRange($event, y)"
/>
</div>
<!-- StartValue -->
<div v-if="x.Name == '标签'" class="input_label" @click="showlabel(y)">
<div
v-if="x.Name == '标签' && (x.Direction == 1 || x.Direction == 2 || x.Direction == 3 || x.Direction == '')"
class="input_label"
@click="showlabel(y)"
>
<div style="display: flex;" v-if="x.StartValue && x.StartValue.length > 0">
<div
class="text-clamp-1 tag-select-input"
......@@ -121,35 +146,71 @@
<div
v-if="(x.Type === 1 || x.Type === 2 || x.Type === 5 || x.Type == '') && x.Name !== '标签'"
>
<q-select
v-if="x.isSelect"
outlined
v-model="x.StartValue"
:options="x.OptionsList"
dense
label="请选择"
class="my-special-class"
option-value="Id"
option-label="Name"
emit-value
map-options
/>
<q-input v-if="!x.isSelect&&x.Direction" outlined v-model="x.StartValue" label="请输入" dense />
<div v-if="x.isSelect">
<q-select
v-if="x.Name == '客户阶段' && (x.Direction == 1 || x.Direction == 2 || x.Direction == '')"
outlined
v-model="x.StartValue"
:options="x.OptionsList"
dense
label="请选择"
class="my-special-class"
option-value="Id"
option-label="Name"
emit-value
map-options
/>
<q-select
v-if="x.Name !== '客户阶段'"
outlined
v-model="x.StartValue"
:options="x.OptionsList"
dense
label="请选择"
class="my-special-class"
option-value="Id"
option-label="Name"
emit-value
map-options
/>
</div>
<div v-if="!x.isSelect">
<q-input
v-if="x.Type == 1 && (x.Direction == 1 || x.Direction == 2 || x.Direction == 3 || x.Direction == '')"
outlined
v-model="x.StartValue"
label="请输入"
dense
/>
<q-input
v-if="x.Type == 2 && (x.Direction == 1 || x.Direction == 2 || x.Direction == '')"
outlined
v-model="x.StartValue"
label="请输入"
dense
/>
<q-input
v-if="x.Type == 5 || x.Type == ''"
outlined
v-model="x.StartValue"
label="请输入"
dense
/>
</div>
</div>
<!-- 新增和删除 -->
<div style="display: flex;align-items: center;">
<img
src="../../assets/images/customer/delete.png"
alt
v-if="addMsg.length > 1"
style="width: 20px;height: 20px;margin-left: 10px;"
@click="deleteadd(y)"
/>
<img
src="../../assets/images/customer/add.png"
alt
v-if="addMsg.length == y + 1"
v-if="addMsg.length == y + 1 && addMsg.length < 10"
style="width: 20px;height: 20px;margin-left: 10px;"
@click="addsList()"
/>
......@@ -187,19 +248,28 @@ import {
} from 'vue'
import customerService from '@/api/customer'
import labelgroup from './label-group.vue'
import dayjs, { Dayjs } from 'dayjs'
import locale from 'ant-design-vue/es/date-picker/locale/zh_CN';
interface params {
Name: number | string
IsCustom: number
Type: number | string
Id?: number | string
Direction?: string
StartValue?: string
StartValue?: string | Array<any>
EndValue?: string
disable?: boolean
directionList?: Array<any>
OptionsList?: Array<any>
isSelect?: boolean
rangeArr?: Array<any>
}
interface dateParams {
value: string | number
label: string
children?: Array<dateParams>
}
const format = "YYYY/MM/DD HH:mm:ss"
export default defineComponent({
props: {
addCondition: {
......@@ -210,13 +280,33 @@ export default defineComponent({
components: {
labelgroup,
},
setup(props) {
setup(props, ctx) {
let rangeArr = ref<Dayjs[]>([])
let birthday = ref([])//只有一个
let addtion = ref(props.addCondition)
let filedList = ref<Array<params>>([]); //客户字段数组
let addMsg = ref<Array<params>>([]) //筛选数组
let isshowlabel = ref(false) //标签弹出显示
let selectindex = ref(0) //现在筛选数组 索引
let LableList = ref<Array<any> | string>([]) //标签的数组
//日期数组
let dateOptions = ref<Array<dateParams>>([])
let year: any = new Date().getFullYear()
for (let i = 1; i <= 12; i++) {
let obj: dateParams = {
value: i < 10 ? '0' + i : i,
label: i + '月',
children: []
}
let day = new Date(year, i, 0).getDate()
for (let d = 1; d <= day; d++) {
obj.children?.push({
value: d < 10 ? '0' + d : d,
label: d + '号',
})
}
dateOptions.value.push(obj)
}
const directionList1 = [{
Id: 1,
Name: '包含所有'
......@@ -320,7 +410,6 @@ export default defineComponent({
EndValue: '',
IsCustom: 2,
directionList: directionList2
}
addMsg.value.push(obj)
}
......@@ -380,7 +469,8 @@ export default defineComponent({
//标签改变
let changeName = (val: any, y: number) => {
addMsg.value[y].StartValue = ''
addMsg.value[y].EndValue = ''
switch (val) {
case "标签": {
addMsg.value[y].IsCustom = 2
......@@ -397,7 +487,6 @@ export default defineComponent({
let find: any = filedList.value.find((e) => {
return e.Id == val
})
console.log(400, find)
switch (find.Type) {
case 1: {
addMsg.value[y].directionList = directionList2
......@@ -427,7 +516,6 @@ export default defineComponent({
addMsg.value[y].isSelect = true
addMsg.value[y].OptionsList = find.OptionsList
}
console.log(426, addMsg.value[y])
break;
}
case 5: {
......@@ -438,6 +526,7 @@ export default defineComponent({
case 6: {
addMsg.value[y].Type = 4
addMsg.value[y].isSelect = false
addMsg.value[y].rangeArr = []
break;
}
case 7: {
......@@ -448,14 +537,44 @@ export default defineComponent({
}
}
}
let changeDate = (value, y) => {
console.log(500, value, y)
addMsg.value[y].StartValue = value.join('-')
}
let changeRange = (val, y) => {
let a = dayjs(val[0]._d).format(format)
let b = dayjs(val[1]._d).format(format)
addMsg.value[y].StartValue = a
addMsg.value[y].EndValue = b
}
watch(() => [...addMsg.value], (val) => {
console.log('watch', val)
changeLabel()
let newVal: Array<params> = []
val.map((e: params) => {
let item: params = JSON.parse(JSON.stringify(e))
if (e.OptionsList) {
delete item.OptionsList
}
if (e.directionList) {
delete item.directionList
}
if (e.Name == '标签' && Array.isArray(e.StartValue)) {
item.StartValue = e.StartValue.map(e => e.Id).toString()
}
delete item.isSelect
newVal.push(item)
})
console.log('watch', newVal)
ctx.emit('change', newVal)
}, { deep: true })
onMounted(() => { //进入页面就调用
getCustomerFiledList(); //获取客户字段
})
return {
birthday,
rangeArr,
dateOptions,
getCustomerFiledList,
filedList,
addMsg,
......@@ -467,9 +586,38 @@ export default defineComponent({
LableList,
showlabel,
getlabel,
changeName
changeName,
changeDate,
changeRange,
locale,
}
}
})
</script>
\ No newline at end of file
</script>
<style lang="scss" scoped>
::v-deep .ant-cascader-picker {
border-radius: 4px;
border-color: rgb(0 0 0 / 24%);
overflow: hidden;
}
</style>
<style>
/*修改滚动条样式*/
ul::-webkit-scrollbar {
width: 6px;
height: 10px;
/**/
}
ul::-webkit-scrollbar-track {
background: rgb(239, 239, 239);
border-radius: 3px;
}
ul::-webkit-scrollbar-thumb {
background: #bfbfbf;
border-radius: 10px;
}
ul::-webkit-scrollbar-thumb:hover {
background: #333;
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment